diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-05-29 01:33:59 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-05-30 04:01:11 -0400 |
commit | 491af9903b858ee7c36735dc31708fe4074ce56f (patch) | |
tree | 3617b5b496f610bffe9142ba07f6395bfe513497 /arch/s390 | |
parent | 2e30db9522837e2a5d30ce1e66afb0a7ee0ff350 (diff) |
s390/uaccess: fix access_ok compile warnings
On s390 access_ok is a macro which discards all parameters and always
returns 1. This can result in compile warnings which warn about unused
variables like this:
fs/read_write.c: In function 'rw_copy_check_uvector':
fs/read_write.c:684:16: warning: unused variable 'buf' [-Wunused-variable]
Fix this by adding a __range_ok() function which consumes all parameters
but still always returns 1.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/uaccess.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index 8e83da66df0d..1f3a79bcd262 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h | |||
@@ -50,10 +50,15 @@ | |||
50 | 50 | ||
51 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) | 51 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) |
52 | 52 | ||
53 | #define __access_ok(addr, size) \ | 53 | static inline int __range_ok(unsigned long addr, unsigned long size) |
54 | ({ \ | 54 | { |
55 | __chk_user_ptr(addr); \ | 55 | return 1; |
56 | 1; \ | 56 | } |
57 | |||
58 | #define __access_ok(addr, size) \ | ||
59 | ({ \ | ||
60 | __chk_user_ptr(addr); \ | ||
61 | __range_ok((unsigned long)(addr), (size)); \ | ||
57 | }) | 62 | }) |
58 | 63 | ||
59 | #define access_ok(type, addr, size) __access_ok(addr, size) | 64 | #define access_ok(type, addr, size) __access_ok(addr, size) |