History

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.

Nick Desaulniers committed 5 years ago

Commit ff72daa1 parent 2f787881 file · +0 −4Browse files

Showing the changes to lib/string.c (1 of 1 file). Show all

Unified · Split

lib/string.c+0−4
@@ -85,7 +85,6 @@ EXPORT_SYMBOL(strcasecmp); · 84 unmodified lines
85 * @dest: Where to copy the string to85 * @dest: Where to copy the string to
86 * @src: Where to copy the string from86 * @src: Where to copy the string from
87 */87 */
88#undef strcpy
89char *strcpy(char *dest, const char *src)88char *strcpy(char *dest, const char *src)
90{89{
91 char *tmp = dest;90 char *tmp = dest;
@@ -302,7 +301,6 @@ EXPORT_SYMBOL(stpcpy); · 210 unmodified lines
302 * @dest: The string to be appended to301 * @dest: The string to be appended to
303 * @src: The string to append to it302 * @src: The string to append to it
304 */303 */
305#undef strcat
306char *strcat(char *dest, const char *src)304char *strcat(char *dest, const char *src)
307{305{
308 char *tmp = dest;306 char *tmp = dest;
@@ -378,7 +376,6 @@ EXPORT_SYMBOL(strlcat); · 69 unmodified lines
378 * @cs: One string376 * @cs: One string
379 * @ct: Another string377 * @ct: Another string
380 */378 */
381#undef strcmp
382int strcmp(const char *cs, const char *ct)379int strcmp(const char *cs, const char *ct)
383{380{
384 unsigned char c1, c2;381 unsigned char c1, c2;
@@ -958,7 +955,6 @@ EXPORT_SYMBOL(memcmp); · 573 unmodified lines
958 * while this particular implementation is a simple (tail) call to memcmp, do955 * while this particular implementation is a simple (tail) call to memcmp, do
959 * not rely on anything but whether the return value is zero or non-zero.956 * not rely on anything but whether the return value is zero or non-zero.
960 */957 */
961#undef bcmp
962int bcmp(const void *a, const void *b, size_t len)958int bcmp(const void *a, const void *b, size_t len)
963{959{
964 return memcmp(a, b, len);960 return memcmp(a, b, len);