Commit 10503bf9 authored by Al Viro's avatar Al Viro

get rid of unused __strncpy_from_user() instances

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 82985258
...@@ -172,12 +172,6 @@ extern unsigned long __copy_user(void __user *to, const void *from, unsigned lon ...@@ -172,12 +172,6 @@ extern unsigned long __copy_user(void __user *to, const void *from, unsigned lon
extern unsigned long __copy_user_in(void *to, const void __user *from, unsigned long n); extern unsigned long __copy_user_in(void *to, const void __user *from, unsigned long n);
extern unsigned long __do_clear_user(void __user *to, unsigned long n); extern unsigned long __do_clear_user(void __user *to, unsigned long n);
static inline long
__strncpy_from_user(char *dst, const char __user *src, long count)
{
return __do_strncpy_from_user(dst, src, count);
}
static inline long static inline long
strncpy_from_user(char *dst, const char __user *src, long count) strncpy_from_user(char *dst, const char __user *src, long count)
{ {
......
...@@ -482,8 +482,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n) ...@@ -482,8 +482,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
long __must_check strncpy_from_user(char *dst, const char __user *src, long __must_check strncpy_from_user(char *dst, const char __user *src,
long count); long count);
long __must_check __strncpy_from_user(char *dst,
const char __user *src, long count);
/** /**
* __clear_user: - Zero a block of memory in user space, with less checking. * __clear_user: - Zero a block of memory in user space, with less checking.
......
...@@ -23,7 +23,6 @@ EXPORT_SYMBOL(__ioremap); ...@@ -23,7 +23,6 @@ EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(strncpy_from_user); EXPORT_SYMBOL(strncpy_from_user);
EXPORT_SYMBOL(__strncpy_from_user);
EXPORT_SYMBOL(clear_user); EXPORT_SYMBOL(clear_user);
EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(strnlen_user); EXPORT_SYMBOL(strnlen_user);
......
...@@ -88,14 +88,6 @@ do { \ ...@@ -88,14 +88,6 @@ do { \
#endif /* CONFIG_ISA_DUAL_ISSUE */ #endif /* CONFIG_ISA_DUAL_ISSUE */
long
__strncpy_from_user(char *dst, const char __user *src, long count)
{
long res;
__do_strncpy_from_user(dst, src, count, res);
return res;
}
long long
strncpy_from_user(char *dst, const char __user *src, long count) strncpy_from_user(char *dst, const char __user *src, long count)
{ {
......
...@@ -355,14 +355,12 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n) ...@@ -355,14 +355,12 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
*/ */
extern int __strncpy_user(char *to, const char __user *from, int len); extern int __strncpy_user(char *to, const char __user *from, int len);
#define __strncpy_from_user __strncpy_user
static inline long static inline long
strncpy_from_user(char *dst, const char __user *src, long count) strncpy_from_user(char *dst, const char __user *src, long count)
{ {
if (!access_ok(VERIFY_READ, src, 1)) if (!access_ok(VERIFY_READ, src, 1))
return -EFAULT; return -EFAULT;
return __strncpy_from_user(dst, src, count); return __strncpy_user(dst, src, count);
} }
/* /*
......
...@@ -967,60 +967,6 @@ __clear_user(void __user *addr, __kernel_size_t size) ...@@ -967,60 +967,6 @@ __clear_user(void __user *addr, __kernel_size_t size)
__cl_size; \ __cl_size; \
}) })
extern long __strncpy_from_kernel_nocheck_asm(char *__to, const char __user *__from, long __len);
extern long __strncpy_from_user_nocheck_asm(char *__to, const char __user *__from, long __len);
/*
* __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
* @dst: Destination address, in kernel space. This buffer must be at
* least @count bytes long.
* @src: Source address, in user space.
* @count: Maximum number of bytes to copy, including the trailing NUL.
*
* Copies a NUL-terminated string from userspace to kernel space.
* Caller must check the specified block with access_ok() before calling
* this function.
*
* On success, returns the length of the string (not including the trailing
* NUL).
*
* If access to userspace fails, returns -EFAULT (some data may have been
* copied).
*
* If @count is smaller than the length of the string, copies @count bytes
* and returns @count.
*/
static inline long
__strncpy_from_user(char *__to, const char __user *__from, long __len)
{
long res;
if (eva_kernel_access()) {
__asm__ __volatile__(
"move\t$4, %1\n\t"
"move\t$5, %2\n\t"
"move\t$6, %3\n\t"
__MODULE_JAL(__strncpy_from_kernel_nocheck_asm)
"move\t%0, $2"
: "=r" (res)
: "r" (__to), "r" (__from), "r" (__len)
: "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
} else {
might_fault();
__asm__ __volatile__(
"move\t$4, %1\n\t"
"move\t$5, %2\n\t"
"move\t$6, %3\n\t"
__MODULE_JAL(__strncpy_from_user_nocheck_asm)
"move\t%0, $2"
: "=r" (res)
: "r" (__to), "r" (__from), "r" (__len)
: "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
}
return res;
}
extern long __strncpy_from_kernel_asm(char *__to, const char __user *__from, long __len); extern long __strncpy_from_kernel_asm(char *__to, const char __user *__from, long __len);
extern long __strncpy_from_user_asm(char *__to, const char __user *__from, long __len); extern long __strncpy_from_user_asm(char *__to, const char __user *__from, long __len);
......
...@@ -35,7 +35,6 @@ LEAF(__strncpy_from_\func\()_asm) ...@@ -35,7 +35,6 @@ LEAF(__strncpy_from_\func\()_asm)
and v0, a1 and v0, a1
bnez v0, .Lfault\@ bnez v0, .Lfault\@
FEXPORT(__strncpy_from_\func\()_nocheck_asm)
move t0, zero move t0, zero
move v1, a1 move v1, a1
.ifeqs "\func","kernel" .ifeqs "\func","kernel"
...@@ -70,16 +69,12 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm) ...@@ -70,16 +69,12 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm)
#ifndef CONFIG_EVA #ifndef CONFIG_EVA
/* Set aliases */ /* Set aliases */
.global __strncpy_from_user_asm .global __strncpy_from_user_asm
.global __strncpy_from_user_nocheck_asm
.set __strncpy_from_user_asm, __strncpy_from_kernel_asm .set __strncpy_from_user_asm, __strncpy_from_kernel_asm
.set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm
EXPORT_SYMBOL(__strncpy_from_user_asm) EXPORT_SYMBOL(__strncpy_from_user_asm)
EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
#endif #endif
__BUILD_STRNCPY_ASM kernel __BUILD_STRNCPY_ASM kernel
EXPORT_SYMBOL(__strncpy_from_kernel_asm) EXPORT_SYMBOL(__strncpy_from_kernel_asm)
EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm)
#ifdef CONFIG_EVA #ifdef CONFIG_EVA
.set push .set push
...@@ -87,5 +82,4 @@ EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm) ...@@ -87,5 +82,4 @@ EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm)
__BUILD_STRNCPY_ASM user __BUILD_STRNCPY_ASM user
.set pop .set pop
EXPORT_SYMBOL(__strncpy_from_user_asm) EXPORT_SYMBOL(__strncpy_from_user_asm)
EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
#endif #endif
...@@ -290,7 +290,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n) ...@@ -290,7 +290,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
} }
extern long strncpy_from_user(char *dst, const char __user *src, long count); extern long strncpy_from_user(char *dst, const char __user *src, long count);
extern long __strncpy_from_user(char *dst, const char __user *src, long count);
extern long strnlen_user(const char __user *str, long n); extern long strnlen_user(const char __user *str, long n);
extern unsigned long clear_user(void __user *mem, unsigned long len); extern unsigned long clear_user(void __user *mem, unsigned long len);
extern unsigned long __clear_user(void __user *mem, unsigned long len); extern unsigned long __clear_user(void __user *mem, unsigned long len);
......
...@@ -23,7 +23,6 @@ EXPORT_SYMBOL(memmove); ...@@ -23,7 +23,6 @@ EXPORT_SYMBOL(memmove);
EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(strncpy_from_user); EXPORT_SYMBOL(strncpy_from_user);
EXPORT_SYMBOL(__strncpy_from_user);
EXPORT_SYMBOL(clear_user); EXPORT_SYMBOL(clear_user);
EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(strnlen_user); EXPORT_SYMBOL(strnlen_user);
......
...@@ -49,14 +49,6 @@ do { \ ...@@ -49,14 +49,6 @@ do { \
: "memory", "cc"); \ : "memory", "cc"); \
} while (0) } while (0)
long
__strncpy_from_user(char *dst, const char *src, long count)
{
long res;
__do_strncpy_from_user(dst, src, count, res);
return res;
}
long long
strncpy_from_user(char *dst, const char *src, long count) strncpy_from_user(char *dst, const char *src, long count)
{ {
......
...@@ -278,13 +278,12 @@ clear_user(void *addr, unsigned long size) ...@@ -278,13 +278,12 @@ clear_user(void *addr, unsigned long size)
extern long __strncpy_user(char *, const char *, long); extern long __strncpy_user(char *, const char *, long);
#define __strncpy_from_user __strncpy_user
static inline long static inline long
strncpy_from_user(char *dst, const char *src, long count) strncpy_from_user(char *dst, const char *src, long count)
{ {
if (access_ok(VERIFY_READ, src, 1)) if (access_ok(VERIFY_READ, src, 1))
return __strncpy_from_user(dst, src, count); return __strncpy_user(dst, src, count);
return -EFAULT; return -EFAULT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment