openrisc: use generic strncpy_from_user
As per commits2922585b93
("lib: Sparc's strncpy_from_user is generic enough, move under lib/") and92ae03f2ef
("x86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up"), and corresponding discussion on linux-arch. Signed-off-by: Jonas Bonn <jonas@southpole.se> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
ece78b7df7
commit
603d6637ae
@@ -313,14 +313,10 @@ clear_user(void *addr, unsigned long size)
|
||||
return size;
|
||||
}
|
||||
|
||||
extern int __strncpy_from_user(char *dst, const char *src, long count);
|
||||
#define user_addr_max() \
|
||||
(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
|
||||
|
||||
static inline long strncpy_from_user(char *dst, const char *src, long count)
|
||||
{
|
||||
if (access_ok(VERIFY_READ, src, 1))
|
||||
return __strncpy_from_user(dst, src, count);
|
||||
return -EFAULT;
|
||||
}
|
||||
extern long strncpy_from_user(char *dest, const char __user *src, long count);
|
||||
|
||||
/*
|
||||
* Return the size of a string (including the ending 0)
|
||||
|
Reference in New Issue
Block a user