aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68knommu/uaccess.h
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2006-07-12 19:32:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-13 10:51:48 -0400
commit1b0f06d0b4860a8a73dc0b48540d82d8897ead71 (patch)
treedaeca25611fa75a1439f35b54d1586e24ea77478 /include/asm-m68knommu/uaccess.h
parentb43c7cec6bf9558336fb033d1217fc765d259c47 (diff)
[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: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m68knommu/uaccess.h')
-rw-r--r--include/asm-m68knommu/uaccess.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index 05be9515a2d..62b29b10bc6 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -93,7 +93,7 @@ extern int __put_user_bad(void);
93#define get_user(x, ptr) \ 93#define get_user(x, ptr) \
94({ \ 94({ \
95 int __gu_err = 0; \ 95 int __gu_err = 0; \
96 typeof(*(ptr)) __gu_val = 0; \ 96 typeof(x) __gu_val = 0; \
97 switch (sizeof(*(ptr))) { \ 97 switch (sizeof(*(ptr))) { \
98 case 1: \ 98 case 1: \
99 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ 99 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \
@@ -105,23 +105,23 @@ extern int __put_user_bad(void);
105 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ 105 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
106 break; \ 106 break; \
107 case 8: \ 107 case 8: \
108 memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ 108 memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \
109 break; \ 109 break; \
110 default: \ 110 default: \
111 __gu_val = 0; \ 111 __gu_val = 0; \
112 __gu_err = __get_user_bad(); \ 112 __gu_err = __get_user_bad(); \
113 break; \ 113 break; \
114 } \ 114 } \
115 (x) = __gu_val; \ 115 (x) = (typeof(*(ptr))) __gu_val; \
116 __gu_err; \ 116 __gu_err; \
117}) 117})
118#define __get_user(x, ptr) get_user(x, ptr) 118#define __get_user(x, ptr) get_user(x, ptr)
119 119
120extern int __get_user_bad(void); 120extern int __get_user_bad(void);
121 121
122#define __get_user_asm(err,x,ptr,bwl,reg) \ 122#define __get_user_asm(err,x,ptr,bwl,reg) \
123 __asm__ ("move" #bwl " %1,%0" \ 123 __asm__ ("move" #bwl " %1,%0" \
124 : "=d" (x) \ 124 : "=d" (x) \
125 : "m" (*__ptr(ptr))) 125 : "m" (*__ptr(ptr)))
126 126
127#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) 127#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)