summaryrefslogtreecommitdiff
path: root/arch/nios2/mm/uaccess.c
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2017-05-08 17:14:14 +0800
committerLey Foon Tan <ley.foon.tan@intel.com>2017-05-08 17:14:14 +0800
commit7f1e614113ffe75f5ea7c99f641bf1b56f85be03 (patch)
tree18c95adccb9ce60cddd4f1407639678bcc74dbfd /arch/nios2/mm/uaccess.c
parentedebea98777d7090ea14bdce2e38e6798557729d (diff)
nios2: use generic strncpy_from_user() and strnlen_user()
This change enables the generic strncpy_from_user() and strnlen_user() Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Diffstat (limited to 'arch/nios2/mm/uaccess.c')
-rw-r--r--arch/nios2/mm/uaccess.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/arch/nios2/mm/uaccess.c b/arch/nios2/mm/uaccess.c
index 804983317766..34f10af8ea40 100644
--- a/arch/nios2/mm/uaccess.c
+++ b/arch/nios2/mm/uaccess.c
@@ -128,36 +128,3 @@ asm(
".word 12b,13b\n"
".previous\n");
EXPORT_SYMBOL(raw_copy_to_user);
-
-long strncpy_from_user(char *__to, const char __user *__from, long __len)
-{
- int l = strnlen_user(__from, __len);
- int is_zt = 1;
-
- if (l > __len) {
- is_zt = 0;
- l = __len;
- }
-
- if (l == 0 || copy_from_user(__to, __from, l))
- return -EFAULT;
-
- if (is_zt)
- l--;
- return l;
-}
-
-long strnlen_user(const char __user *s, long n)
-{
- long i;
-
- for (i = 0; i < n; i++) {
- char c;
-
- if (get_user(c, s + i) == -EFAULT)
- return 0;
- if (c == 0)
- return i + 1;
- }
- return n + 1;
-}