asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user
authorArnd Bergmann <arnd@arndb.de>
Sat, 23 Jan 2021 14:21:22 +0000 (15:21 +0100)
committerArnd Bergmann <arnd@arndb.de>
Tue, 27 Jul 2021 21:01:13 +0000 (23:01 +0200)
commit98b861a304318e60eea584bef123d924e5d0dcff
treeea6c7fa898e97596e5e865a90213a6a1d1e565db
parente93a1cb8d2b3dccd31bde77373c8d5619f0e0a10
asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user

The inline version is used on three NOMMU architectures and is
particularly inefficient when it scans the string one byte at a time
twice. It also lacks a check for user_addr_max(), but this is
probably ok on NOMMU targets.

Consolidate the asm-generic implementation with the library version
that is used everywhere else.  This version is generalized enough to
work efficiently on both MMU and NOMMU targets, and using the
same code everywhere reduces the potential for subtle bugs.

Mark the prototypes as __must_check in the process.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/h8300/Kconfig
arch/m68k/Kconfig
arch/riscv/Kconfig
include/asm-generic/uaccess.h