diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-03-04 17:29:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-04 19:35:16 -0500 |
commit | 07f2402b4adbcd0e6822ddc27953b63d4504faec (patch) | |
tree | d1fca3d0493cf7d08298951a4cf26e6c33f3733e /include/asm-cris | |
parent | cee47f5a32a1b5a1c8b148e738249946e3fedb95 (diff) |
cris: correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h
Function __copy_user_zeroing in arch/lib/usercopy.c had the wrong parameter
set as __user, and in include/asm-cris/uaccess.h, it was not set at all for
some of the calling functions.
This will cut the number of warnings quite dramatically when using sparse.
While we're here, remove useless CVS log and correct confusing typo.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-cris')
-rw-r--r-- | include/asm-cris/uaccess.h | 53 |
1 files changed, 9 insertions, 44 deletions
diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h index 69d48a2dc8e..ea11eaf0e92 100644 --- a/include/asm-cris/uaccess.h +++ b/include/asm-cris/uaccess.h | |||
@@ -1,43 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Authors: Bjorn Wesen (bjornw@axis.com) | 2 | * Authors: Bjorn Wesen (bjornw@axis.com) |
3 | * Hans-Peter Nilsson (hp@axis.com) | 3 | * Hans-Peter Nilsson (hp@axis.com) |
4 | * | ||
5 | * $Log: uaccess.h,v $ | ||
6 | * Revision 1.8 2001/10/29 13:01:48 bjornw | ||
7 | * Removed unused variable tmp2 in strnlen_user | ||
8 | * | ||
9 | * Revision 1.7 2001/10/02 12:44:52 hp | ||
10 | * Add support for 64-bit put_user/get_user | ||
11 | * | ||
12 | * Revision 1.6 2001/10/01 14:51:17 bjornw | ||
13 | * Added register prefixes and removed underscores | ||
14 | * | ||
15 | * Revision 1.5 2000/10/25 03:33:21 hp | ||
16 | * - Provide implementation for everything else but get_user and put_user; | ||
17 | * copying inline to/from user for constant length 0..16, 20, 24, and | ||
18 | * clearing for 0..4, 8, 12, 16, 20, 24, strncpy_from_user and strnlen_user | ||
19 | * always inline. | ||
20 | * - Constraints for destination addr in get_user cannot be memory, only reg. | ||
21 | * - Correct labels for PC at expected fault points. | ||
22 | * - Nits with assembly code. | ||
23 | * - Don't use statement expressions without value; use "do {} while (0)". | ||
24 | * - Return correct values from __generic_... functions. | ||
25 | * | ||
26 | * Revision 1.4 2000/09/12 16:28:25 bjornw | ||
27 | * * Removed comments from the get/put user asm code | ||
28 | * * Constrains for destination addr in put_user cannot be memory, only reg | ||
29 | * | ||
30 | * Revision 1.3 2000/09/12 14:30:20 bjornw | ||
31 | * MAX_ADDR_USER does not exist anymore | ||
32 | * | ||
33 | * Revision 1.2 2000/07/13 15:52:48 bjornw | ||
34 | * New user-access functions | ||
35 | * | ||
36 | * Revision 1.1.1.1 2000/07/10 16:32:31 bjornw | ||
37 | * CRIS architecture, working draft | ||
38 | * | ||
39 | * | ||
40 | * | ||
41 | */ | 4 | */ |
42 | 5 | ||
43 | /* Asm:s have been tweaked (within the domain of correctness) to give | 6 | /* Asm:s have been tweaked (within the domain of correctness) to give |
@@ -209,9 +172,9 @@ extern long __get_user_bad(void); | |||
209 | /* More complex functions. Most are inline, but some call functions that | 172 | /* More complex functions. Most are inline, but some call functions that |
210 | live in lib/usercopy.c */ | 173 | live in lib/usercopy.c */ |
211 | 174 | ||
212 | extern unsigned long __copy_user(void *to, const void *from, unsigned long n); | 175 | extern unsigned long __copy_user(void __user *to, const void *from, unsigned long n); |
213 | extern unsigned long __copy_user_zeroing(void *to, const void *from, unsigned long n); | 176 | extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n); |
214 | extern unsigned long __do_clear_user(void *to, unsigned long n); | 177 | extern unsigned long __do_clear_user(void __user *to, unsigned long n); |
215 | 178 | ||
216 | static inline unsigned long | 179 | static inline unsigned long |
217 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) | 180 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) |
@@ -253,7 +216,7 @@ strncpy_from_user(char *dst, const char __user *src, long count) | |||
253 | } | 216 | } |
254 | 217 | ||
255 | 218 | ||
256 | /* Note that if these expand awfully if made into switch constructs, so | 219 | /* Note that these expand awfully if made into switch constructs, so |
257 | don't do that. */ | 220 | don't do that. */ |
258 | 221 | ||
259 | static inline unsigned long | 222 | static inline unsigned long |
@@ -407,19 +370,21 @@ __constant_clear_user(void __user *to, unsigned long n) | |||
407 | */ | 370 | */ |
408 | 371 | ||
409 | static inline unsigned long | 372 | static inline unsigned long |
410 | __generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n) | 373 | __generic_copy_from_user_nocheck(void *to, const void __user *from, |
374 | unsigned long n) | ||
411 | { | 375 | { |
412 | return __copy_user_zeroing(to,from,n); | 376 | return __copy_user_zeroing(to,from,n); |
413 | } | 377 | } |
414 | 378 | ||
415 | static inline unsigned long | 379 | static inline unsigned long |
416 | __generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n) | 380 | __generic_copy_to_user_nocheck(void __user *to, const void *from, |
381 | unsigned long n) | ||
417 | { | 382 | { |
418 | return __copy_user(to,from,n); | 383 | return __copy_user(to,from,n); |
419 | } | 384 | } |
420 | 385 | ||
421 | static inline unsigned long | 386 | static inline unsigned long |
422 | __generic_clear_user_nocheck(void *to, unsigned long n) | 387 | __generic_clear_user_nocheck(void __user *to, unsigned long n) |
423 | { | 388 | { |
424 | return __do_clear_user(to,n); | 389 | return __do_clear_user(to,n); |
425 | } | 390 | } |