Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc502142 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull user access str* updates from Al Viro:
 "uaccess str...() dead code removal"

* 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  s390 keyboard.c: don't open-code strndup_user()
  mips: get rid of unused __strnlen_user()
  get rid of unused __strncpy_from_user() instances
  kill strlen_user()
parents 90880b53 b7310105
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -326,7 +326,6 @@ clear_user(void __user *to, long len)
        (uaccess_kernel() ? ~0UL : TASK_SIZE)

extern long strncpy_from_user(char *dest, const char __user *src, long count);
extern __must_check long strlen_user(const char __user *str);
extern __must_check long strnlen_user(const char __user *str, long n);

#include <asm/extable.h>
+0 −1
Original line number Diff line number Diff line
@@ -526,7 +526,6 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo
/* These are from lib/ code, and use __get_user() and friends */
extern long strncpy_from_user(char *dest, const char __user *src, long count);

extern __must_check long strlen_user(const char __user *str);
extern __must_check long strnlen_user(const char __user *str, long n);

#endif /* _ASMARM_UACCESS_H */
+0 −1
Original line number Diff line number Diff line
@@ -349,7 +349,6 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo

extern long strncpy_from_user(char *dest, const char __user *src, long count);

extern __must_check long strlen_user(const char __user *str);
extern __must_check long strnlen_user(const char __user *str, long n);

#endif /* __ASM_UACCESS_H */
+0 −7
Original line number Diff line number Diff line
@@ -194,13 +194,6 @@ static inline long __must_check strnlen_user(const char __user *src, long n)
	return strnlen((const char __force *)src, n) + 1;
}

static inline long __must_check strlen_user(const char __user *src)
{
	if (!access_ok(VERIFY_READ, src, 1))
		return 0;
	return strlen((const char __force *)src) + 1;
}

/*
 * Zero Userspace
 */
+0 −8
Original line number Diff line number Diff line
@@ -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 __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
strncpy_from_user(char *dst, const char __user *src, long count)
{
@@ -363,6 +357,4 @@ __clear_user(void __user *to, unsigned long n)
	return __do_clear_user(to, n);
}

#define strlen_user(str)	strnlen_user((str), 0x7ffffffe)

#endif	/* _CRIS_UACCESS_H */
Loading