summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2026-03-23 04:16:06 +0300
committerKees Cook <kees@kernel.org>2026-06-19 02:37:12 +0300
commitad3242a9acaa01cc9ecc6e483341697ca4f77461 (patch)
tree956688ab040c84755d3ec572b6971cd670913445
parent4cb5e246e65cd497155370bbca54c8f5e3a4105f (diff)
downloadlinux-ad3242a9acaa01cc9ecc6e483341697ca4f77461.tar.xz
m68k: Remove arch-specific strncpy() implementation
strncpy() has no remaining callers in the kernel[1]. Remove the m68k-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/m68k/include/asm/string.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h
index 760cc13acdf4..ae6a6b51ad07 100644
--- a/arch/m68k/include/asm/string.h
+++ b/arch/m68k/include/asm/string.h
@@ -21,23 +21,6 @@ static inline size_t strnlen(const char *s, size_t count)
return sc - s;
}
-#define __HAVE_ARCH_STRNCPY
-static inline char *strncpy(char *dest, const char *src, size_t n)
-{
- char *xdest = dest;
-
- asm volatile ("\n"
- " jra 2f\n"
- "1: move.b (%1),(%0)+\n"
- " jeq 2f\n"
- " addq.l #1,%1\n"
- "2: subq.l #1,%2\n"
- " jcc 1b\n"
- : "+a" (dest), "+a" (src), "+d" (n)
- : : "memory");
- return xdest;
-}
-
#define __HAVE_ARCH_MEMMOVE
extern void *memmove(void *, const void *, __kernel_size_t);