linux-mips
[Top] [All Lists]

[PATCH] fix warning: incompatiable argument type of clear_user

To: Linux MIPS List <linux-mips@linux-mips.org>
Subject: [PATCH] fix warning: incompatiable argument type of clear_user
From: Wu Zhangjin <wuzhangjin@gmail.com>
Date: Tue, 12 May 2009 14:22:32 +0800
Cc: Ralf Baechle <ralf@linux-mips.org>, zhangfx@lemote.com, yanh@lemote.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; 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; d=gmail.com; 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;linux-mips@linux-mips.org
Reply-to: wuzhangjin@gmail.com
Sender: linux-mips-bounce@linux-mips.org
hi, Ralf

there are lots of warnings about the macro: clear_user in linux-mips.
in linux-2.6.29.3, 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
b/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
size)
        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 <=