Commit 8833d328caf009f8da58337e17a2cf5d52993a7c

Authored by Kyle McMartin
Committed by Linus Torvalds
1 parent 894b5779ce

[PATCH] Clean up arch-overrides in linux/string.h

Some string functions were safely overrideable in lib/string.c, but their
corresponding declarations in linux/string.h were not.  Correct this, and
make strcspn overrideable.

Odds of someone wanting to do optimized assembly of these are small, but
for the sake of cleanliness, might as well bring them into line with the
rest of the file.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 14 additions and 5 deletions Side-by-side Diff

include/linux/string.h
... ... @@ -13,11 +13,6 @@
13 13 extern "C" {
14 14 #endif
15 15  
16   -extern char * strpbrk(const char *,const char *);
17   -extern char * strsep(char **,const char *);
18   -extern __kernel_size_t strspn(const char *,const char *);
19   -extern __kernel_size_t strcspn(const char *,const char *);
20   -
21 16 extern char *strndup_user(const char __user *, long);
22 17  
23 18 /*
... ... @@ -69,6 +64,18 @@
69 64 #endif
70 65 #ifndef __HAVE_ARCH_STRNLEN
71 66 extern __kernel_size_t strnlen(const char *,__kernel_size_t);
  67 +#endif
  68 +#ifndef __HAVE_ARCH_STRPBRK
  69 +extern char * strpbrk(const char *,const char *);
  70 +#endif
  71 +#ifndef __HAVE_ARCH_STRSEP
  72 +extern char * strsep(char **,const char *);
  73 +#endif
  74 +#ifndef __HAVE_ARCH_STRSPN
  75 +extern __kernel_size_t strspn(const char *,const char *);
  76 +#endif
  77 +#ifndef __HAVE_ARCH_STRCSPN
  78 +extern __kernel_size_t strcspn(const char *,const char *);
72 79 #endif
73 80  
74 81 #ifndef __HAVE_ARCH_MEMSET
... ... @@ -362,6 +362,7 @@
362 362 EXPORT_SYMBOL(strspn);
363 363 #endif
364 364  
  365 +#ifndef __HAVE_ARCH_STRCSPN
365 366 /**
366 367 * strcspn - Calculate the length of the initial substring of @s which does
367 368 * not contain letters in @reject
... ... @@ -384,6 +385,7 @@
384 385 return count;
385 386 }
386 387 EXPORT_SYMBOL(strcspn);
  388 +#endif
387 389  
388 390 #ifndef __HAVE_ARCH_STRPBRK
389 391 /**