aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/uaccess.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-05-26 10:30:36 -0400
committerIngo Molnar <mingo@kernel.org>2013-05-28 03:41:05 -0400
commite0acd0bd0594161be44c054bb6b984972f444beb (patch)
treea1f786a535ff25a14341cf8b110c1fe0b20c6e37 /include/asm-generic/uaccess.h
parente4aa937ec75df0eea0bee03bffa3303ad36c986b (diff)
asm-generic: uaccess s/might_sleep/might_fault/
The only reason uaccess routines might sleep is if they fault. Make this explicit. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1369577426-26721-1-git-send-email-mst@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/asm-generic/uaccess.h')
-rw-r--r--include/asm-generic/uaccess.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index c184aa8ec8cd..dc1269c74a52 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to,
163 163
164#define put_user(x, ptr) \ 164#define put_user(x, ptr) \
165({ \ 165({ \
166 might_sleep(); \ 166 might_fault(); \
167 access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ 167 access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \
168 __put_user(x, ptr) : \ 168 __put_user(x, ptr) : \
169 -EFAULT; \ 169 -EFAULT; \
@@ -225,7 +225,7 @@ extern int __put_user_bad(void) __attribute__((noreturn));
225 225
226#define get_user(x, ptr) \ 226#define get_user(x, ptr) \
227({ \ 227({ \
228 might_sleep(); \ 228 might_fault(); \
229 access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ 229 access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \
230 __get_user(x, ptr) : \ 230 __get_user(x, ptr) : \
231 -EFAULT; \ 231 -EFAULT; \
@@ -255,7 +255,7 @@ extern int __get_user_bad(void) __attribute__((noreturn));
255static inline long copy_from_user(void *to, 255static inline long copy_from_user(void *to,
256 const void __user * from, unsigned long n) 256 const void __user * from, unsigned long n)
257{ 257{
258 might_sleep(); 258 might_fault();
259 if (access_ok(VERIFY_READ, from, n)) 259 if (access_ok(VERIFY_READ, from, n))
260 return __copy_from_user(to, from, n); 260 return __copy_from_user(to, from, n);
261 else 261 else
@@ -265,7 +265,7 @@ static inline long copy_from_user(void *to,
265static inline long copy_to_user(void __user *to, 265static inline long copy_to_user(void __user *to,
266 const void *from, unsigned long n) 266 const void *from, unsigned long n)
267{ 267{
268 might_sleep(); 268 might_fault();
269 if (access_ok(VERIFY_WRITE, to, n)) 269 if (access_ok(VERIFY_WRITE, to, n))
270 return __copy_to_user(to, from, n); 270 return __copy_to_user(to, from, n);
271 else 271 else
@@ -336,7 +336,7 @@ __clear_user(void __user *to, unsigned long n)
336static inline __must_check unsigned long 336static inline __must_check unsigned long
337clear_user(void __user *to, unsigned long n) 337clear_user(void __user *to, unsigned long n)
338{ 338{
339 might_sleep(); 339 might_fault();
340 if (!access_ok(VERIFY_WRITE, to, n)) 340 if (!access_ok(VERIFY_WRITE, to, n))
341 return n; 341 return n;
342 342