Skip to content

Commit 10503bf

Browse files
author
Al Viro
committed
get rid of unused __strncpy_from_user() instances
Signed-off-by: Al Viro <[email protected]>
1 parent 8298525 commit 10503bf

File tree

11 files changed

+2
-92
lines changed

11 files changed

+2
-92
lines changed

arch/cris/include/asm/uaccess.h

-6
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ extern unsigned long __copy_user(void __user *to, const void *from, unsigned lon
172172
extern unsigned long __copy_user_in(void *to, const void __user *from, unsigned long n);
173173
extern unsigned long __do_clear_user(void __user *to, unsigned long n);
174174

175-
static inline long
176-
__strncpy_from_user(char *dst, const char __user *src, long count)
177-
{
178-
return __do_strncpy_from_user(dst, src, count);
179-
}
180-
181175
static inline long
182176
strncpy_from_user(char *dst, const char __user *src, long count)
183177
{

arch/m32r/include/asm/uaccess.h

-2
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
482482

483483
long __must_check strncpy_from_user(char *dst, const char __user *src,
484484
long count);
485-
long __must_check __strncpy_from_user(char *dst,
486-
const char __user *src, long count);
487485

488486
/**
489487
* __clear_user: - Zero a block of memory in user space, with less checking.

arch/m32r/kernel/m32r_ksyms.c

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ EXPORT_SYMBOL(__ioremap);
2323
EXPORT_SYMBOL(iounmap);
2424

2525
EXPORT_SYMBOL(strncpy_from_user);
26-
EXPORT_SYMBOL(__strncpy_from_user);
2726
EXPORT_SYMBOL(clear_user);
2827
EXPORT_SYMBOL(__clear_user);
2928
EXPORT_SYMBOL(strnlen_user);

arch/m32r/lib/usercopy.c

-8
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,6 @@ do { \
8888

8989
#endif /* CONFIG_ISA_DUAL_ISSUE */
9090

91-
long
92-
__strncpy_from_user(char *dst, const char __user *src, long count)
93-
{
94-
long res;
95-
__do_strncpy_from_user(dst, src, count, res);
96-
return res;
97-
}
98-
9991
long
10092
strncpy_from_user(char *dst, const char __user *src, long count)
10193
{

arch/microblaze/include/asm/uaccess.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,12 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
355355
*/
356356
extern int __strncpy_user(char *to, const char __user *from, int len);
357357

358-
#define __strncpy_from_user __strncpy_user
359-
360358
static inline long
361359
strncpy_from_user(char *dst, const char __user *src, long count)
362360
{
363361
if (!access_ok(VERIFY_READ, src, 1))
364362
return -EFAULT;
365-
return __strncpy_from_user(dst, src, count);
363+
return __strncpy_user(dst, src, count);
366364
}
367365

368366
/*

arch/mips/include/asm/uaccess.h

-54
Original file line numberDiff line numberDiff line change
@@ -967,60 +967,6 @@ __clear_user(void __user *addr, __kernel_size_t size)
967967
__cl_size; \
968968
})
969969

970-
extern long __strncpy_from_kernel_nocheck_asm(char *__to, const char __user *__from, long __len);
971-
extern long __strncpy_from_user_nocheck_asm(char *__to, const char __user *__from, long __len);
972-
973-
/*
974-
* __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
975-
* @dst: Destination address, in kernel space. This buffer must be at
976-
* least @count bytes long.
977-
* @src: Source address, in user space.
978-
* @count: Maximum number of bytes to copy, including the trailing NUL.
979-
*
980-
* Copies a NUL-terminated string from userspace to kernel space.
981-
* Caller must check the specified block with access_ok() before calling
982-
* this function.
983-
*
984-
* On success, returns the length of the string (not including the trailing
985-
* NUL).
986-
*
987-
* If access to userspace fails, returns -EFAULT (some data may have been
988-
* copied).
989-
*
990-
* If @count is smaller than the length of the string, copies @count bytes
991-
* and returns @count.
992-
*/
993-
static inline long
994-
__strncpy_from_user(char *__to, const char __user *__from, long __len)
995-
{
996-
long res;
997-
998-
if (eva_kernel_access()) {
999-
__asm__ __volatile__(
1000-
"move\t$4, %1\n\t"
1001-
"move\t$5, %2\n\t"
1002-
"move\t$6, %3\n\t"
1003-
__MODULE_JAL(__strncpy_from_kernel_nocheck_asm)
1004-
"move\t%0, $2"
1005-
: "=r" (res)
1006-
: "r" (__to), "r" (__from), "r" (__len)
1007-
: "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
1008-
} else {
1009-
might_fault();
1010-
__asm__ __volatile__(
1011-
"move\t$4, %1\n\t"
1012-
"move\t$5, %2\n\t"
1013-
"move\t$6, %3\n\t"
1014-
__MODULE_JAL(__strncpy_from_user_nocheck_asm)
1015-
"move\t%0, $2"
1016-
: "=r" (res)
1017-
: "r" (__to), "r" (__from), "r" (__len)
1018-
: "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
1019-
}
1020-
1021-
return res;
1022-
}
1023-
1024970
extern long __strncpy_from_kernel_asm(char *__to, const char __user *__from, long __len);
1025971
extern long __strncpy_from_user_asm(char *__to, const char __user *__from, long __len);
1026972

arch/mips/lib/strncpy_user.S

-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ LEAF(__strncpy_from_\func\()_asm)
3535
and v0, a1
3636
bnez v0, .Lfault\@
3737

38-
FEXPORT(__strncpy_from_\func\()_nocheck_asm)
3938
move t0, zero
4039
move v1, a1
4140
.ifeqs "\func","kernel"
@@ -70,22 +69,17 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm)
7069
#ifndef CONFIG_EVA
7170
/* Set aliases */
7271
.global __strncpy_from_user_asm
73-
.global __strncpy_from_user_nocheck_asm
7472
.set __strncpy_from_user_asm, __strncpy_from_kernel_asm
75-
.set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm
7673
EXPORT_SYMBOL(__strncpy_from_user_asm)
77-
EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
7874
#endif
7975

8076
__BUILD_STRNCPY_ASM kernel
8177
EXPORT_SYMBOL(__strncpy_from_kernel_asm)
82-
EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm)
8378

8479
#ifdef CONFIG_EVA
8580
.set push
8681
.set eva
8782
__BUILD_STRNCPY_ASM user
8883
.set pop
8984
EXPORT_SYMBOL(__strncpy_from_user_asm)
90-
EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
9185
#endif

arch/mn10300/include/asm/uaccess.h

-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
290290
}
291291

292292
extern long strncpy_from_user(char *dst, const char __user *src, long count);
293-
extern long __strncpy_from_user(char *dst, const char __user *src, long count);
294293
extern long strnlen_user(const char __user *str, long n);
295294
extern unsigned long clear_user(void __user *mem, unsigned long len);
296295
extern unsigned long __clear_user(void __user *mem, unsigned long len);

arch/mn10300/kernel/mn10300_ksyms.c

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ EXPORT_SYMBOL(memmove);
2323
EXPORT_SYMBOL(memset);
2424

2525
EXPORT_SYMBOL(strncpy_from_user);
26-
EXPORT_SYMBOL(__strncpy_from_user);
2726
EXPORT_SYMBOL(clear_user);
2827
EXPORT_SYMBOL(__clear_user);
2928
EXPORT_SYMBOL(strnlen_user);

arch/mn10300/lib/usercopy.c

-8
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ do { \
4949
: "memory", "cc"); \
5050
} while (0)
5151

52-
long
53-
__strncpy_from_user(char *dst, const char *src, long count)
54-
{
55-
long res;
56-
__do_strncpy_from_user(dst, src, count, res);
57-
return res;
58-
}
59-
6052
long
6153
strncpy_from_user(char *dst, const char *src, long count)
6254
{

arch/xtensa/include/asm/uaccess.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,12 @@ clear_user(void *addr, unsigned long size)
278278

279279

280280
extern long __strncpy_user(char *, const char *, long);
281-
#define __strncpy_from_user __strncpy_user
282281

283282
static inline long
284283
strncpy_from_user(char *dst, const char *src, long count)
285284
{
286285
if (access_ok(VERIFY_READ, src, 1))
287-
return __strncpy_from_user(dst, src, count);
286+
return __strncpy_user(dst, src, count);
288287
return -EFAULT;
289288
}
290289

0 commit comments

Comments
 (0)