diff options
author | Andi Kleen <ak@suse.de> | 2006-09-26 04:52:39 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:39 -0400 |
commit | 95912008ba1fb9d0677c1ce5930aeb0e85ba5710 (patch) | |
tree | e84c614f6aff984d105ce9f340f9474b613d567d /include/asm-x86_64 | |
parent | 3022d734a54cbd2b65eea9a024564821101b4a9a (diff) |
[PATCH] Add __must_check to copy_*_user
Following i386.
And also fix the two occurrences that caused warnings in arch/x86_64/*
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/i387.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/uaccess.h | 46 |
2 files changed, 29 insertions, 21 deletions
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h index 60c0f4853fdb..0217b74cc9fc 100644 --- a/include/asm-x86_64/i387.h +++ b/include/asm-x86_64/i387.h | |||
@@ -137,8 +137,8 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) | |||
137 | #else | 137 | #else |
138 | : [fx] "cdaSDb" (fx), "0" (0)); | 138 | : [fx] "cdaSDb" (fx), "0" (0)); |
139 | #endif | 139 | #endif |
140 | if (unlikely(err)) | 140 | if (unlikely(err) && __clear_user(fx, sizeof(struct i387_fxsave_struct))) |
141 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); | 141 | err = -EFAULT; |
142 | /* No need to clear here because the caller clears USED_MATH */ | 142 | /* No need to clear here because the caller clears USED_MATH */ |
143 | return err; | 143 | return err; |
144 | } | 144 | } |
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index bc6812009bd7..802a4a068ef6 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h | |||
@@ -237,14 +237,18 @@ do { \ | |||
237 | */ | 237 | */ |
238 | 238 | ||
239 | /* Handles exceptions in both to and from, but doesn't do access_ok */ | 239 | /* Handles exceptions in both to and from, but doesn't do access_ok */ |
240 | extern unsigned long copy_user_generic(void *to, const void *from, unsigned len); | 240 | __must_check unsigned long |
241 | extern unsigned long copy_user_generic_dontzero(void *to, const void *from, unsigned len); | 241 | copy_user_generic(void *to, const void *from, unsigned len); |
242 | 242 | ||
243 | extern unsigned long copy_to_user(void __user *to, const void *from, unsigned len); | 243 | __must_check unsigned long |
244 | extern unsigned long copy_from_user(void *to, const void __user *from, unsigned len); | 244 | copy_to_user(void __user *to, const void *from, unsigned len); |
245 | extern unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len); | 245 | __must_check unsigned long |
246 | 246 | copy_from_user(void *to, const void __user *from, unsigned len); | |
247 | static __always_inline int __copy_from_user(void *dst, const void __user *src, unsigned size) | 247 | __must_check unsigned long |
248 | copy_in_user(void __user *to, const void __user *from, unsigned len); | ||
249 | |||
250 | static __always_inline __must_check | ||
251 | int __copy_from_user(void *dst, const void __user *src, unsigned size) | ||
248 | { | 252 | { |
249 | int ret = 0; | 253 | int ret = 0; |
250 | if (!__builtin_constant_p(size)) | 254 | if (!__builtin_constant_p(size)) |
@@ -273,7 +277,8 @@ static __always_inline int __copy_from_user(void *dst, const void __user *src, u | |||
273 | } | 277 | } |
274 | } | 278 | } |
275 | 279 | ||
276 | static __always_inline int __copy_to_user(void __user *dst, const void *src, unsigned size) | 280 | static __always_inline __must_check |
281 | int __copy_to_user(void __user *dst, const void *src, unsigned size) | ||
277 | { | 282 | { |
278 | int ret = 0; | 283 | int ret = 0; |
279 | if (!__builtin_constant_p(size)) | 284 | if (!__builtin_constant_p(size)) |
@@ -304,7 +309,8 @@ static __always_inline int __copy_to_user(void __user *dst, const void *src, uns | |||
304 | } | 309 | } |
305 | } | 310 | } |
306 | 311 | ||
307 | static __always_inline int __copy_in_user(void __user *dst, const void __user *src, unsigned size) | 312 | static __always_inline __must_check |
313 | int __copy_in_user(void __user *dst, const void __user *src, unsigned size) | ||
308 | { | 314 | { |
309 | int ret = 0; | 315 | int ret = 0; |
310 | if (!__builtin_constant_p(size)) | 316 | if (!__builtin_constant_p(size)) |
@@ -344,15 +350,17 @@ static __always_inline int __copy_in_user(void __user *dst, const void __user *s | |||
344 | } | 350 | } |
345 | } | 351 | } |
346 | 352 | ||
347 | long strncpy_from_user(char *dst, const char __user *src, long count); | 353 | __must_check long |
348 | long __strncpy_from_user(char *dst, const char __user *src, long count); | 354 | strncpy_from_user(char *dst, const char __user *src, long count); |
349 | long strnlen_user(const char __user *str, long n); | 355 | __must_check long |
350 | long __strnlen_user(const char __user *str, long n); | 356 | __strncpy_from_user(char *dst, const char __user *src, long count); |
351 | long strlen_user(const char __user *str); | 357 | __must_check long strnlen_user(const char __user *str, long n); |
352 | unsigned long clear_user(void __user *mem, unsigned long len); | 358 | __must_check long __strnlen_user(const char __user *str, long n); |
353 | unsigned long __clear_user(void __user *mem, unsigned long len); | 359 | __must_check long strlen_user(const char __user *str); |
354 | 360 | __must_check unsigned long clear_user(void __user *mem, unsigned long len); | |
355 | extern long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size); | 361 | __must_check unsigned long __clear_user(void __user *mem, unsigned long len); |
362 | |||
363 | __must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size); | ||
356 | #define __copy_to_user_inatomic copy_user_generic | 364 | #define __copy_to_user_inatomic copy_user_generic |
357 | 365 | ||
358 | #endif /* __X86_64_UACCESS_H */ | 366 | #endif /* __X86_64_UACCESS_H */ |