Commit b0bfb63118612e3614cf77b115c00f895a42c96a

Authored by Rasmus Villemoes
Committed by Linus Torvalds
1 parent cd514e727b

lib: string: Make all calls to strnicmp into calls to strncasecmp

The previous patch made strnicmp into a wrapper for strncasecmp.

This patch makes all in-tree users of strnicmp call strncasecmp
directly, while still making sure that the strnicmp symbol can be used
by out-of-tree modules.  It should be considered a temporary hack until
all in-tree callers have been converted.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

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

include/linux/string.h
... ... @@ -41,7 +41,7 @@
41 41 extern int strncmp(const char *,const char *,__kernel_size_t);
42 42 #endif
43 43 #ifndef __HAVE_ARCH_STRNICMP
44   -extern int strnicmp(const char *, const char *, __kernel_size_t);
  44 +#define strnicmp strncasecmp
45 45 #endif
46 46 #ifndef __HAVE_ARCH_STRCASECMP
47 47 extern int strcasecmp(const char *s1, const char *s2);
... ... @@ -59,6 +59,7 @@
59 59 EXPORT_SYMBOL(strncasecmp);
60 60 #endif
61 61 #ifndef __HAVE_ARCH_STRNICMP
  62 +#undef strnicmp
62 63 int strnicmp(const char *s1, const char *s2, size_t len)
63 64 {
64 65 return strncasecmp(s1, s2, len);