Commit 1b0f06d0 authored by Greg Ungerer's avatar Greg Ungerer Committed by Linus Torvalds

[PATCH] m68knommu: fix result type in get_user() macro

Keep the result holder variable the same type as the quantity we are
retreiving in the get_user() macro - don't go through a pointer version
of the user space address type.

Using the address type causes problems if the address type was const
(newer versions of gcc quite rightly error out for that condition).
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b43c7cec
...@@ -93,7 +93,7 @@ extern int __put_user_bad(void); ...@@ -93,7 +93,7 @@ extern int __put_user_bad(void);
#define get_user(x, ptr) \ #define get_user(x, ptr) \
({ \ ({ \
int __gu_err = 0; \ int __gu_err = 0; \
typeof(*(ptr)) __gu_val = 0; \ typeof(x) __gu_val = 0; \
switch (sizeof(*(ptr))) { \ switch (sizeof(*(ptr))) { \
case 1: \ case 1: \
__get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \
...@@ -105,14 +105,14 @@ extern int __put_user_bad(void); ...@@ -105,14 +105,14 @@ extern int __put_user_bad(void);
__get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
break; \ break; \
case 8: \ case 8: \
memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \
break; \ break; \
default: \ default: \
__gu_val = 0; \ __gu_val = 0; \
__gu_err = __get_user_bad(); \ __gu_err = __get_user_bad(); \
break; \ break; \
} \ } \
(x) = __gu_val; \ (x) = (typeof(*(ptr))) __gu_val; \
__gu_err; \ __gu_err; \
}) })
#define __get_user(x, ptr) get_user(x, ptr) #define __get_user(x, ptr) get_user(x, ptr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment