[PATCH 4/4] asm-generic: uaccess: fix access_ok() prototype
From: Mike Frysinger
Date: Sun Jun 14 2009 - 02:01:02 EST
From: Arnd Bergmann <arnd@xxxxxxxx>
The access_ok() function operates on a pointer, not unsigned long.
Otherwise builds result in a crazy amount of warnings such as:
CC [M] fs/smbfs/request.o
In file included from
/usr/local/src/linux/linux-2.6/arch/blackfin/include/asm/uaccess.h:17,
from include/net/checksum.h:26,
from include/linux/skbuff.h:28,
from include/linux/ip.h:109,
from include/net/ip.h:27,
from fs/smbfs/smbiod.c:23:
include/asm-generic/uaccess.h: In function âcopy_from_userâ:
include/asm-generic/uaccess.h:247: warning: passing argument 1 of
â_access_okâ makes integer from pointer without a cast
include/asm-generic/uaccess.h: In function âcopy_to_userâ:
include/asm-generic/uaccess.h:257: warning: passing argument 1 of
â_access_okâ makes integer from pointer without a cast
include/asm-generic/uaccess.h: In function âstrncpy_from_userâ:
include/asm-generic/uaccess.h:281: warning: passing argument 1 of
â_access_okâ makes integer from pointer without a cast
include/asm-generic/uaccess.h: In function âclear_userâ:
include/asm-generic/uaccess.h:319: warning: passing argument 1 of
â_access_okâ makes integer from pointer without a cast
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
include/asm-generic/uaccess.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index d3a9519..4b32dab 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -37,14 +37,14 @@ static inline void set_fs(mm_segment_t fs)
#define VERIFY_READ 0
#define VERIFY_WRITE 1
-#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
+#define access_ok(type, addr, size) __access_ok((addr), (size))
/*
* The architecture should really override this if possible, at least
* doing a check on the get_fs()
*/
#ifndef __access_ok
-static inline int __access_ok(unsigned long addr, unsigned long size)
+static inline int __access_ok(void __user *ptr, unsigned long size)
{
return 1;
}
--
1.6.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/