]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
string: remove more pointless __HAVE_ARCH_STR*
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Wed, 8 Jul 2026 20:37:06 +0000 (22:37 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 21 Jul 2026 19:51:07 +0000 (13:51 -0600)
None of these six macros are defined by any architecture. Moreover,
the ifndef guard only exists in either string.h or string.c, making them
completely pointless.

I'm not sure whether we have an explicit coding style discouraging the
"extern" qualifier on function declarations, and string.h has a random
mix of everything, but I can't leave it on strncasecmp() now that it
will be immediately after strcasecmp() which doesn't have it.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
include/linux/string.h
lib/string.c

index 5bcbf72a89b43218652c3593d4b8a55741259169..5e4594b19df6cf80f2c96663bbc5551439b65671 100644 (file)
@@ -43,12 +43,8 @@ extern int strcmp(const char *,const char *);
 #ifndef __HAVE_ARCH_STRNCMP
 extern int strncmp(const char *,const char *,__kernel_size_t);
 #endif
-#ifndef __HAVE_ARCH_STRCASECMP
 int strcasecmp(const char *s1, const char *s2);
-#endif
-#ifndef __HAVE_ARCH_STRNCASECMP
-extern int strncasecmp(const char *s1, const char *s2, __kernel_size_t len);
-#endif
+int strncasecmp(const char *s1, const char *s2, __kernel_size_t len);
 #ifndef __HAVE_ARCH_STRCHR
 extern char * strchr(const char *,int);
 #endif
index 82d0b6a9caa107a82ed3ff467746c2eac19d8b14..20c934c18c3f42ba76e114b371d2026710436cf3 100644 (file)
@@ -399,7 +399,6 @@ void kfree_const(const void *x)
 }
 
 
-#ifndef __HAVE_ARCH_STRSPN
 /**
  * strspn - Calculate the length of the initial substring of @s which only
  *     contain letters in @accept
@@ -424,9 +423,7 @@ size_t strspn(const char *s, const char *accept)
 
        return count;
 }
-#endif
 
-#ifndef __HAVE_ARCH_STRPBRK
 /**
  * strpbrk - Find the first occurrence of a set of characters
  * @cs: The string to be searched
@@ -444,9 +441,7 @@ char * strpbrk(const char * cs,const char * ct)
        }
        return NULL;
 }
-#endif
 
-#ifndef __HAVE_ARCH_STRTOK
 /**
  * strtok - Split a string into tokens
  * @s: The string to be searched
@@ -473,9 +468,7 @@ char * strtok(char * s,const char * ct)
        ___strtok = send;
        return (sbegin);
 }
-#endif
 
-#ifndef __HAVE_ARCH_STRSEP
 /**
  * strsep - Split a string into tokens
  * @s: The string to be searched
@@ -501,7 +494,6 @@ char * strsep(char **s, const char *ct)
 
        return sbegin;
 }
-#endif
 
 #ifndef __HAVE_ARCH_MEMSET
 /**