mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
[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>
This commit is contained in:
parent
56dc6a88ec
commit
a63a4931c3
2 changed files with 9 additions and 7 deletions
|
@ -279,7 +279,7 @@ asmlinkage long sys32_getegid16(void)
|
||||||
|
|
||||||
static inline long get_tv32(struct timeval *o, struct compat_timeval *i)
|
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_sec, &i->tv_sec) ||
|
||||||
__get_user(o->tv_usec, &i->tv_usec)));
|
__get_user(o->tv_usec, &i->tv_usec)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,10 @@
|
||||||
#define segment_eq(a,b) ((a).ar4 == (b).ar4)
|
#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)
|
#define access_ok(type,addr,size) __access_ok(addr,size)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -206,25 +208,25 @@ extern int __put_user_bad(void) __attribute__((noreturn));
|
||||||
case 1: { \
|
case 1: { \
|
||||||
unsigned char __x; \
|
unsigned char __x; \
|
||||||
__get_user_asm(__x, ptr, __gu_err); \
|
__get_user_asm(__x, ptr, __gu_err); \
|
||||||
(x) = (__typeof__(*(ptr))) __x; \
|
(x) = *(__typeof__(*(ptr)) *) &__x; \
|
||||||
break; \
|
break; \
|
||||||
}; \
|
}; \
|
||||||
case 2: { \
|
case 2: { \
|
||||||
unsigned short __x; \
|
unsigned short __x; \
|
||||||
__get_user_asm(__x, ptr, __gu_err); \
|
__get_user_asm(__x, ptr, __gu_err); \
|
||||||
(x) = (__typeof__(*(ptr))) __x; \
|
(x) = *(__typeof__(*(ptr)) *) &__x; \
|
||||||
break; \
|
break; \
|
||||||
}; \
|
}; \
|
||||||
case 4: { \
|
case 4: { \
|
||||||
unsigned int __x; \
|
unsigned int __x; \
|
||||||
__get_user_asm(__x, ptr, __gu_err); \
|
__get_user_asm(__x, ptr, __gu_err); \
|
||||||
(x) = (__typeof__(*(ptr))) __x; \
|
(x) = *(__typeof__(*(ptr)) *) &__x; \
|
||||||
break; \
|
break; \
|
||||||
}; \
|
}; \
|
||||||
case 8: { \
|
case 8: { \
|
||||||
unsigned long long __x; \
|
unsigned long long __x; \
|
||||||
__get_user_asm(__x, ptr, __gu_err); \
|
__get_user_asm(__x, ptr, __gu_err); \
|
||||||
(x) = (__typeof__(*(ptr))) __x; \
|
(x) = *(__typeof__(*(ptr)) *) &__x; \
|
||||||
break; \
|
break; \
|
||||||
}; \
|
}; \
|
||||||
default: \
|
default: \
|
||||||
|
|
Loading…
Reference in a new issue