diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-04-14 22:17:20 +0200 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-06-24 19:44:18 +0200 |
commit | d346a5db02fc16263b44eb511fcb260265e3ef77 (patch) | |
tree | 063226819b893487e4d9026ff6623490a2ea1c67 /arch/m68k/include/asm/string.h | |
parent | 9e895ace5d82df8929b16f58e9f515f6d54ab82d (diff) | |
download | linux-stable-d346a5db02fc16263b44eb511fcb260265e3ef77.tar.gz linux-stable-d346a5db02fc16263b44eb511fcb260265e3ef77.tar.bz2 linux-stable-d346a5db02fc16263b44eb511fcb260265e3ef77.zip |
m68k: Remove inline strcpy() and strcat() implementations
Gcc may replace calls to standard string functions by open code and/or
calls to other standard string functions. If the replacement function is
not available out-of-line, link errors will happen.
To avoid this, the out-of-line versions were provided by
arch/m68k/lib/string.c, but they were usually not linked in anymore as
typically none of its symbols are referenced by built-in code.
However, if any module would need them, they would not be available.
Hence remove the inline strcpy() and strcat() implementations, remove
arch/m68k/lib/string.c, and let the generic string library code handle it.
Impact on a typical kernel build seems minimal or nonexistent:
- .text : 0x00001000 - 0x002aac74 (2728 KiB)
- .data : 0x002ada48 - 0x00392148 ( 914 KiB)
+ .text : 0x00001000 - 0x002aacf4 (2728 KiB)
+ .data : 0x002adac8 - 0x00392148 ( 914 KiB)
See also commit e00c73ee05dc38ecaccced55d4f5fc58b0b769f7 ("m68k: Remove
inline strlen() implementation").
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/include/asm/string.h')
-rw-r--r-- | arch/m68k/include/asm/string.h | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index 9aea9f11fa25..c30c03d98581 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h @@ -4,20 +4,6 @@ #include <linux/types.h> #include <linux/compiler.h> -static inline char *__kernel_strcpy(char *dest, const char *src) -{ - char *xdest = dest; - - asm volatile ("\n" - "1: move.b (%1)+,(%0)+\n" - " jne 1b" - : "+a" (dest), "+a" (src) - : : "memory"); - return xdest; -} - -#ifndef __IN_STRING_C - #define __HAVE_ARCH_STRNLEN static inline size_t strnlen(const char *s, size_t count) { @@ -34,16 +20,6 @@ static inline size_t strnlen(const char *s, size_t count) return sc - s; } -#define __HAVE_ARCH_STRCPY -#if __GNUC__ >= 4 -#define strcpy(d, s) (__builtin_constant_p(s) && \ - __builtin_strlen(s) <= 32 ? \ - __builtin_strcpy(d, s) : \ - __kernel_strcpy(d, s)) -#else -#define strcpy(d, s) __kernel_strcpy(d, s) -#endif - #define __HAVE_ARCH_STRNCPY static inline char *strncpy(char *dest, const char *src, size_t n) { @@ -61,12 +37,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n) return xdest; } -#define __HAVE_ARCH_STRCAT -#define strcat(d, s) ({ \ - char *__d = (d); \ - strcpy(__d + strlen(__d), (s)); \ -}) - #ifndef CONFIG_COLDFIRE #define __HAVE_ARCH_STRCMP static inline int strcmp(const char *cs, const char *ct) @@ -100,6 +70,4 @@ extern void *memset(void *, int, __kernel_size_t); extern void *memcpy(void *, const void *, __kernel_size_t); #define memcpy(d, s, n) __builtin_memcpy(d, s, n) -#endif - #endif /* _M68K_STRING_H_ */ |