]> err.no Git - linux-2.6/commitdiff
[PATCH] s390: uaccess warnings
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 6 Jan 2006 08:19:09 +0000 (00:19 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:49 +0000 (08:33 -0800)
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>
arch/s390/kernel/compat_linux.c
include/asm-s390/uaccess.h

index ed877d0f27e6e038b12c24489ac1e3914d7ba478..41b197a3f3a390c58fcac826dd20f2dfc482f910 100644 (file)
@@ -279,7 +279,7 @@ asmlinkage long sys32_getegid16(void)
 
 static inline long get_tv32(struct timeval *o, struct compat_timeval *i)
 {
-       return (!access_ok(VERIFY_READ, tv32, sizeof(*tv32)) ||
+       return (!access_ok(VERIFY_READ, o, sizeof(*o)) ||
                (__get_user(o->tv_sec, &i->tv_sec) ||
                 __get_user(o->tv_usec, &i->tv_usec)));
 }
index 10a619da4761cddd316266891b26c5f69b86cb43..be104f21c70a004dd8ac0c992267a031c126d3d7 100644 (file)
 #define segment_eq(a,b) ((a).ar4 == (b).ar4)
 
 
-#define __access_ok(addr,size) (1)
-
+static inline int __access_ok(const void *addr, unsigned long size)
+{
+       return 1;
+}
 #define access_ok(type,addr,size) __access_ok(addr,size)
 
 /*
@@ -206,25 +208,25 @@ extern int __put_user_bad(void) __attribute__((noreturn));
        case 1: {                                               \
                unsigned char __x;                              \
                __get_user_asm(__x, ptr, __gu_err);             \
-               (x) = (__typeof__(*(ptr))) __x;                 \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
                break;                                          \
        };                                                      \
        case 2: {                                               \
                unsigned short __x;                             \
                __get_user_asm(__x, ptr, __gu_err);             \
-               (x) = (__typeof__(*(ptr))) __x;                 \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
                break;                                          \
        };                                                      \
        case 4: {                                               \
                unsigned int __x;                               \
                __get_user_asm(__x, ptr, __gu_err);             \
-               (x) = (__typeof__(*(ptr))) __x;                 \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
                break;                                          \
        };                                                      \
        case 8: {                                               \
                unsigned long long __x;                         \
                __get_user_asm(__x, ptr, __gu_err);             \
-               (x) = (__typeof__(*(ptr))) __x;                 \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
                break;                                          \
        };                                                      \
        default:                                                \