Commit ff72daa3 authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Linus Torvalds

lib/string: remove unnecessary #undefs

A few architecture specific string.h functions used to be implemented in
terms of preprocessor defines to the corresponding compiler builtins.
Since this is no longer the case, remove unused #undefs.

Only memcmp is still defined in terms of builtins for a few arches.

Link: https://github.com/ClangBuiltLinux/linux/issues/428
Link: https://lkml.kernel.org/r/20201120041113.89382-1-ndesaulniers@google.com
Fixes: 5f074f3e ("lib/string.c: implement a basic bcmp")
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Yury Norov <yury.norov@gmail.com>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2f78788b
...@@ -85,7 +85,6 @@ EXPORT_SYMBOL(strcasecmp); ...@@ -85,7 +85,6 @@ EXPORT_SYMBOL(strcasecmp);
* @dest: Where to copy the string to * @dest: Where to copy the string to
* @src: Where to copy the string from * @src: Where to copy the string from
*/ */
#undef strcpy
char *strcpy(char *dest, const char *src) char *strcpy(char *dest, const char *src)
{ {
char *tmp = dest; char *tmp = dest;
...@@ -302,7 +301,6 @@ EXPORT_SYMBOL(stpcpy); ...@@ -302,7 +301,6 @@ EXPORT_SYMBOL(stpcpy);
* @dest: The string to be appended to * @dest: The string to be appended to
* @src: The string to append to it * @src: The string to append to it
*/ */
#undef strcat
char *strcat(char *dest, const char *src) char *strcat(char *dest, const char *src)
{ {
char *tmp = dest; char *tmp = dest;
...@@ -378,7 +376,6 @@ EXPORT_SYMBOL(strlcat); ...@@ -378,7 +376,6 @@ EXPORT_SYMBOL(strlcat);
* @cs: One string * @cs: One string
* @ct: Another string * @ct: Another string
*/ */
#undef strcmp
int strcmp(const char *cs, const char *ct) int strcmp(const char *cs, const char *ct)
{ {
unsigned char c1, c2; unsigned char c1, c2;
...@@ -958,7 +955,6 @@ EXPORT_SYMBOL(memcmp); ...@@ -958,7 +955,6 @@ EXPORT_SYMBOL(memcmp);
* while this particular implementation is a simple (tail) call to memcmp, do * while this particular implementation is a simple (tail) call to memcmp, do
* not rely on anything but whether the return value is zero or non-zero. * not rely on anything but whether the return value is zero or non-zero.
*/ */
#undef bcmp
int bcmp(const void *a, const void *b, size_t len) int bcmp(const void *a, const void *b, size_t len)
{ {
return memcmp(a, b, len); return memcmp(a, b, len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment