Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] s390: uaccess warnings

Convert __access_ok to an inline C function and change __get_user primitive to
avoid uaccess compiler warnings.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Martin Schwidefsky and committed by
Linus Torvalds
a63a4931 56dc6a88

+9 -7
+1 -1
arch/s390/kernel/compat_linux.c
··· 279 279 280 280 static inline long get_tv32(struct timeval *o, struct compat_timeval *i) 281 281 { 282 - return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) || 282 + return (!access_ok(VERIFY_READ, o, sizeof(*o)) || 283 283 (__get_user(o->tv_sec, &i->tv_sec) || 284 284 __get_user(o->tv_usec, &i->tv_usec))); 285 285 }
+8 -6
include/asm-s390/uaccess.h
··· 61 61 #define segment_eq(a,b) ((a).ar4 == (b).ar4) 62 62 63 63 64 - #define __access_ok(addr,size) (1) 65 - 64 + static inline int __access_ok(const void *addr, unsigned long size) 65 + { 66 + return 1; 67 + } 66 68 #define access_ok(type,addr,size) __access_ok(addr,size) 67 69 68 70 /* ··· 208 206 case 1: { \ 209 207 unsigned char __x; \ 210 208 __get_user_asm(__x, ptr, __gu_err); \ 211 - (x) = (__typeof__(*(ptr))) __x; \ 209 + (x) = *(__typeof__(*(ptr)) *) &__x; \ 212 210 break; \ 213 211 }; \ 214 212 case 2: { \ 215 213 unsigned short __x; \ 216 214 __get_user_asm(__x, ptr, __gu_err); \ 217 - (x) = (__typeof__(*(ptr))) __x; \ 215 + (x) = *(__typeof__(*(ptr)) *) &__x; \ 218 216 break; \ 219 217 }; \ 220 218 case 4: { \ 221 219 unsigned int __x; \ 222 220 __get_user_asm(__x, ptr, __gu_err); \ 223 - (x) = (__typeof__(*(ptr))) __x; \ 221 + (x) = *(__typeof__(*(ptr)) *) &__x; \ 224 222 break; \ 225 223 }; \ 226 224 case 8: { \ 227 225 unsigned long long __x; \ 228 226 __get_user_asm(__x, ptr, __gu_err); \ 229 - (x) = (__typeof__(*(ptr))) __x; \ 227 + (x) = *(__typeof__(*(ptr)) *) &__x; \ 230 228 break; \ 231 229 }; \ 232 230 default: \