aboutsummaryrefslogtreecommitdiff
path: root/mm/maccess.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-22 17:21:27 -0700
committerAlex Shi <alex.shi@linaro.org>2016-08-27 11:23:38 +0800
commit41a69b502d8ff510880646d246d17b8617b8f49a (patch)
tree62d4f352bed0194a40780cffe5c95064caabafa1 /mm/maccess.c
parent30e3024be4f381b3d048ec8a5989f03fb7eb043d (diff)
x86: remove more uaccess_32.h complexity
I'm looking at trying to possibly merge the 32-bit and 64-bit versions of the x86 uaccess.h implementation, but first this needs to be cleaned up. For example, the 32-bit version of "__copy_from_user_inatomic()" is mostly the special cases for the constant size, and it's actually almost never relevant. Most users aren't actually using a constant size anyway, and the few cases that do small constant copies are better off just using __get_user() instead. So get rid of the unnecessary complexity. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit bd28b14591b98f696bc9f94c5ba2e598ca487dfd) Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'mm/maccess.c')
-rw-r--r--mm/maccess.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/maccess.c b/mm/maccess.c
index d159b1c96e48..78f9274dd49d 100644
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -96,8 +96,7 @@ long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)
pagefault_disable();
do {
- ret = __copy_from_user_inatomic(dst++,
- (const void __user __force *)src++, 1);
+ ret = __get_user(*dst++, (const char __user __force *)src++);
} while (dst[-1] && ret == 0 && src - unsafe_addr < count);
dst[-1] = '\0';