aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMister Oyster <oysterized@gmail.com>2017-03-24 22:40:25 +0100
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:32:09 +0200
commit3c7116ab8ea632ec0966ea4f2310edf202da42f0 (patch)
tree107775d45d45b3d0bb1d00e3b58911a15aa1abed
parentb161e77ce00563ec0f49bbbd00ceb73656bde7e6 (diff)
Revert "lib: align source before using optimized implementation"
This reverts commit 0719b9c5323a34bca5a689059048cfbb52520344.
-rw-r--r--lib/strncpy_from_user.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
index 2cd748031..bb2b201d6 100644
--- a/lib/strncpy_from_user.c
+++ b/lib/strncpy_from_user.c
@@ -13,8 +13,6 @@
(((long) dst | (long) src) & (sizeof(long) - 1))
#endif
-#define CHECK_ALIGN(v, a) ((((unsigned long)(v)) & ((a) - 1)) == 0)
-
/*
* Do a strncpy, return length of string without final '\0'.
* 'count' is the user-supplied count (return 'count' if we
@@ -36,21 +34,6 @@ static inline long do_strncpy_from_user(char *dst, const char __user *src, long
if (IS_UNALIGNED(src, dst))
goto byte_at_a_time;
- /* Copy a byte at a time until we align to 8 bytes */
- while (max && (!CHECK_ALIGN(src + res, 8))) {
- char c;
- int ret;
-
- ret = __get_user(c, src + res);
- if (ret)
- return -ret;
- dst[res] = c;
- if (!c)
- return res;
- res++;
- max--;
- }
-
while (max >= sizeof(unsigned long)) {
unsigned long c, data;