summaryrefslogtreecommitdiffstats
path: root/include/asm-um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-03-27 01:14:27 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 08:44:37 -0800
commitbb83da053319e81906473bec08e8f677d6ac615f (patch)
treeb5ee3445db891baf71e4ce358baca740043c0672 /include/asm-um
parentdbffa471611d3fc4b401ebabf7bb63ac0e0272b1 (diff)
downloadop-kernel-dev-bb83da053319e81906473bec08e8f677d6ac615f.zip
op-kernel-dev-bb83da053319e81906473bec08e8f677d6ac615f.tar.gz
[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/asm-um')
-rw-r--r--include/asm-um/uaccess.h31
1 files changed, 10 insertions, 21 deletions
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index 2ee028b..4e460d6 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -41,16 +41,16 @@
#define __get_user(x, ptr) \
({ \
- const __typeof__(ptr) __private_ptr = ptr; \
- __typeof__(*(__private_ptr)) __private_val; \
- int __private_ret = -EFAULT; \
- (x) = (__typeof__(*(__private_ptr)))0; \
- if (__copy_from_user(&__private_val, (__private_ptr), \
- sizeof(*(__private_ptr))) == 0) {\
- (x) = (__typeof__(*(__private_ptr))) __private_val; \
- __private_ret = 0; \
- } \
- __private_ret; \
+ const __typeof__(ptr) __private_ptr = ptr; \
+ __typeof__(x) __private_val; \
+ int __private_ret = -EFAULT; \
+ (x) = (__typeof__(*(__private_ptr)))0; \
+ if (__copy_from_user((void *) &__private_val, (__private_ptr), \
+ sizeof(*(__private_ptr))) == 0) { \
+ (x) = (__typeof__(*(__private_ptr))) __private_val; \
+ __private_ret = 0; \
+ } \
+ __private_ret; \
})
#define get_user(x, ptr) \
@@ -89,14 +89,3 @@ struct exception_table_entry
};
#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
OpenPOWER on IntegriCloud