diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-03-27 04:14:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:37 -0500 |
commit | bb83da053319e81906473bec08e8f677d6ac615f (patch) | |
tree | b5ee3445db891baf71e4ce358baca740043c0672 /include | |
parent | dbffa471611d3fc4b401ebabf7bb63ac0e0272b1 (diff) |
[PATCH] uml: fix build warnings in __get_user
Fix a gcc warning about losing qualifiers to the first argument of
copy_from_user. The typeof change for correctness, and fixes a lot of the
warnings, but there are some cases where x has some extra qualifiers, like
volatile, which copy_from_user can't know about. For these, the void * cast
seems to be necessary.
Also cleaned up some of the whitespace and got rid of the emacs comment at the
bottom.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-um/uaccess.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index 2ee028b8de9d..4e460d6f5ac8 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h | |||
@@ -41,16 +41,16 @@ | |||
41 | 41 | ||
42 | #define __get_user(x, ptr) \ | 42 | #define __get_user(x, ptr) \ |
43 | ({ \ | 43 | ({ \ |
44 | const __typeof__(ptr) __private_ptr = ptr; \ | 44 | const __typeof__(ptr) __private_ptr = ptr; \ |
45 | __typeof__(*(__private_ptr)) __private_val; \ | 45 | __typeof__(x) __private_val; \ |
46 | int __private_ret = -EFAULT; \ | 46 | int __private_ret = -EFAULT; \ |
47 | (x) = (__typeof__(*(__private_ptr)))0; \ | 47 | (x) = (__typeof__(*(__private_ptr)))0; \ |
48 | if (__copy_from_user(&__private_val, (__private_ptr), \ | 48 | if (__copy_from_user((void *) &__private_val, (__private_ptr), \ |
49 | sizeof(*(__private_ptr))) == 0) {\ | 49 | sizeof(*(__private_ptr))) == 0) { \ |
50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ | 50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ |
51 | __private_ret = 0; \ | 51 | __private_ret = 0; \ |
52 | } \ | 52 | } \ |
53 | __private_ret; \ | 53 | __private_ret; \ |
54 | }) | 54 | }) |
55 | 55 | ||
56 | #define get_user(x, ptr) \ | 56 | #define get_user(x, ptr) \ |
@@ -89,14 +89,3 @@ struct exception_table_entry | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | #endif | 91 | #endif |
92 | |||
93 | /* | ||
94 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
95 | * Emacs will notice this stuff at the end of the file and automatically | ||
96 | * adjust the settings for this buffer only. This must remain at the end | ||
97 | * of the file. | ||
98 | * --------------------------------------------------------------------------- | ||
99 | * Local variables: | ||
100 | * c-file-style: "linux" | ||
101 | * End: | ||
102 | */ | ||