]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
m68k: Uninline strchr()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sat, 8 Jan 2011 20:57:48 +0000 (21:57 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Sat, 22 Jan 2011 18:32:54 +0000 (19:32 +0100)
Some versions of gcc replace calls to strstr() with single-character
"needle" string parameters by calls to strchr() behind our back.

If strchr() is defined as an inline function, this causes linking errors
like

ERROR: "strchr" [drivers/target/target_core_mod.ko] undefined!

As m68k is the only architecture that has an inline strchr() and this
inline version is not an optimized asm version, uninline strchr() and use
the standard out-of-line C version in lib/string.c instead.

This also decreases the defconfig/allmodconfig kernel image sizes by a few
hundred bytes.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/include/asm/string.h

index 2936dda938d78d057c2f8c9c7b370b4cf79cb4c6..65b131282837c93c9c1accc198815b2d67532ade 100644 (file)
@@ -81,18 +81,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n)
        strcpy(__d + strlen(__d), (s));         \
 })
 
-#define __HAVE_ARCH_STRCHR
-static inline char *strchr(const char *s, int c)
-{
-       char sc, ch = c;
-
-       for (; (sc = *s++) != ch; ) {
-               if (!sc)
-                       return NULL;
-       }
-       return (char *)s - 1;
-}
-
 #ifndef CONFIG_COLDFIRE
 #define __HAVE_ARCH_STRCMP
 static inline int strcmp(const char *cs, const char *ct)