]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
arm: allow usage of string functions in linux/string.h
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 31 Mar 2009 19:05:35 +0000 (13:05 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 31 Mar 2009 02:35:36 +0000 (13:05 +1030)
In introducing a trivial "strstarts()" function in linux/string.h, we
hit:

arch/arm/boot/compressed/misc.o: In function `strstarts':
misc.c:(.text+0x368): undefined reference to `strlen'
misc.c:(.text+0x378): undefined reference to `strncmp'

This is because of "CFLAGS_misc.o := -Dstatic=" in the Makefile.
"static inline strstarts(...)" becomes non-inline, and refers to the
other string ops.

The simplest workaround is to include asm/string.h.  This makes sense
anyway, since lib/string.c won't be linked against this so we can't
use those functions anyway.

Compile tested here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/boot/compressed/misc.c

index 393c8164131484b03c7f0fa4561d294eb8bd0c31..9e6e512f0117df5227142b06299747647f2db72d 100644 (file)
 
 unsigned int __machine_arch_type;
 
-#include <linux/string.h>
+#include <linux/compiler.h>    /* for inline */
+#include <linux/types.h>       /* for size_t */
+#include <linux/stddef.h>      /* for NULL */
+#include <asm/string.h>
 
 #ifdef STANDALONE_DEBUG
 #define putstr printf