[Top] [All Lists]

[PATCH] fix warning: incompatiable argument type of clear_user

To: Linux MIPS List <>
Subject: [PATCH] fix warning: incompatiable argument type of clear_user
From: Wu Zhangjin <>
Date: Tue, 12 May 2009 14:22:32 +0800
Cc: Ralf Baechle <>,,
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to:cc :content-type:organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=UXwFrAENSB2+LD1YM5LN13QGfcVUr7sm1QgUNAkzRoc=; b=gAnJ/ixnoH4gvGamCXvCwVwRbVOUrhUsnDrLcntKr1x7T7X+QWbTJ3vLh4Qdp+RuSD CeJLpdDRLGqS6rUQFC3zrA9paOaVe6KB33bsTTursh8fJ2uXAly4d3PyoZqEJpZyYOtV 2iXAmLFAhzLY9IldVAA7YIZuB0ZHWhn0FIU4g=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=subject:from:reply-to:to:cc:content-type:organization:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=C81898hQAKrMVGwXixJ2ShUciD4AtoEz1XZtWDKON8dk7ywLPc2v7Tm3PkJMS/IUIU yB/8x2RDjvqAbBOAMCFc2xEwTVCN/MjLqm25l/VqTmZgJ5hfiPIta/+bftTBUqS3wI52 8BuQZo3zLELYdNEcVbsmchVO0RsadLc8TwP/4=
Organization: DSLab, Lanzhou University, China
Original-recipient: rfc822;
hi, Ralf

there are lots of warnings about the macro: clear_user in linux-mips.
in linux-, it will come with errors, so, must be fixed.

the type of the second argument of access_ok should be void __user *,
but there is an un-needed (unsigned long) conversion before __cl_addr,
so remove the (unsigned long) will fix this problem.

       best regards, 
       Wu Zhangjin

diff --git a/arch/mips/include/asm/uaccess.h
index 42b9cec..cd32e9f 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -936,7 +936,7 @@ __clear_user(void __user *addr, __kernel_size_t
        void __user * __cl_addr = (addr);                               \
        unsigned long __cl_size = (n);                                  \
        if (__cl_size && access_ok(VERIFY_WRITE,                        \
-               ((unsigned long)(__cl_addr)), __cl_size))               \
+                                       __cl_addr, __cl_size))          \
                __cl_size = __clear_user(__cl_addr, __cl_size);         \
        __cl_size;                                                      \

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] fix warning: incompatiable argument type of clear_user, Wu Zhangjin <=