diff options
| author | Kees Cook <kees@kernel.org> | 2026-03-23 04:18:34 +0300 |
|---|---|---|
| committer | Kees Cook <kees@kernel.org> | 2026-06-19 02:37:13 +0300 |
| commit | 58c4ce8cd6cd1fbf1bca2e1d1f42f9e2899fa934 (patch) | |
| tree | 0ebbdf4a4ec015411f9ac0aa1eae5848a62154e4 | |
| parent | dfe05fcca83d794cd76da1b6deb2dcd082aa1174 (diff) | |
| download | linux-58c4ce8cd6cd1fbf1bca2e1d1f42f9e2899fa934.tar.xz | |
xtensa: Remove arch-specific strncpy() implementation
strncpy() has no remaining callers in the kernel[1]. Remove the
xtensa-specific inline assembly implementation and __HAVE_ARCH_STRNCPY
define, falling back to the generic version in lib/string.c.
Link: https://github.com/KSPP/linux/issues/90 [1]
Signed-off-by: Kees Cook <kees@kernel.org>
| -rw-r--r-- | arch/xtensa/include/asm/string.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/arch/xtensa/include/asm/string.h b/arch/xtensa/include/asm/string.h index ffce43513fa2..e16cda026df7 100644 --- a/arch/xtensa/include/asm/string.h +++ b/arch/xtensa/include/asm/string.h @@ -34,31 +34,6 @@ static inline char *strcpy(char *__dest, const char *__src) return __xdest; } -#define __HAVE_ARCH_STRNCPY -static inline char *strncpy(char *__dest, const char *__src, size_t __n) -{ - register char *__xdest = __dest; - unsigned long __dummy; - - if (__n == 0) - return __xdest; - - __asm__ __volatile__( - "1:\n\t" - "l8ui %2, %1, 0\n\t" - "s8i %2, %0, 0\n\t" - "addi %1, %1, 1\n\t" - "addi %0, %0, 1\n\t" - "beqz %2, 2f\n\t" - "bne %1, %5, 1b\n" - "2:" - : "=r" (__dest), "=r" (__src), "=&r" (__dummy) - : "0" (__dest), "1" (__src), "r" ((uintptr_t)__src+__n) - : "memory"); - - return __xdest; -} - #define __HAVE_ARCH_STRCMP static inline int strcmp(const char *__cs, const char *__ct) { |
