aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-26 10:24:33 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-03-26 10:24:23 -0400
commit6faf250789dfd35146a71402f9be245be82bf01e (patch)
tree292038593535aa8679af8d2c6a4c632d3ef794ed /arch
parent9c8a08d7a74b07ab2c47e259231d9d0f0047a3c1 (diff)
[S390] allow usage of string functions in linux/string.h
In introducing a trivial "strstarts()" function in linux/string.h, we hit the following error on s390: In file included from include/linux/bitmap.h:8, from include/linux/cpumask.h:142, from include/linux/smp.h:12, from /home/rusty/devel/kernel/patches/linux-2.6/arch/s390/include/asm/spinlock.h:14, from include/linux/spinlock.h:88, from include/linux/seqlock.h:29, from include/linux/time.h:8, from include/linux/stat.h:60, from include/linux/module.h:10, from arch/s390/lib/string.c:13: include/linux/string.h: In function 'strstarts': include/linux/string.h:124: error: implicit declaration of function 'strlen' include/linux/string.h:124: warning: incompatible implicit declaration of built-in function 'strlen' Because when including asm/string.h from arch/s390/lib/string.c we don't declare the string ops we are about to define, and linux/string.h barfs. The fix is to declare them in this IN_ARCH_STRING_C case, but in general I wonder if there's a neater fix. Reported-by: linux-next Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/string.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/s390/include/asm/string.h b/arch/s390/include/asm/string.h
index d074673a6d9b..adf079170aa6 100644
--- a/arch/s390/include/asm/string.h
+++ b/arch/s390/include/asm/string.h
@@ -135,7 +135,13 @@ static inline size_t strnlen(const char * s, size_t n)
135 : "+a" (end), "+a" (tmp) : "d" (r0) : "cc"); 135 : "+a" (end), "+a" (tmp) : "d" (r0) : "cc");
136 return end - s; 136 return end - s;
137} 137}
138 138#else /* IN_ARCH_STRING_C */
139void *memchr(const void * s, int c, size_t n);
140void *memscan(void *s, int c, size_t n);
141char *strcat(char *dst, const char *src);
142char *strcpy(char *dst, const char *src);
143size_t strlen(const char *s);
144size_t strnlen(const char * s, size_t n);
139#endif /* !IN_ARCH_STRING_C */ 145#endif /* !IN_ARCH_STRING_C */
140 146
141#endif /* __KERNEL__ */ 147#endif /* __KERNEL__ */