]> Git Repo - linux.git/commitdiff
s390/string: use generic strlcpy
authorHeiko Carstens <[email protected]>
Thu, 21 Oct 2021 12:43:10 +0000 (14:43 +0200)
committerVasily Gorbik <[email protected]>
Tue, 26 Oct 2021 13:21:30 +0000 (15:21 +0200)
The generic version of strlcpy is identical to the architecure
specific variant.
Therefore use the generic variant.

Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
arch/s390/include/asm/string.h
arch/s390/lib/string.c

index 4f418850bfd6fba1726612340dcfb4082946fe39..3fae93ddb322a9f81c7e41613bf51ef7e0807783 100644 (file)
@@ -31,7 +31,6 @@ void *memmove(void *dest, const void *src, size_t n);
 #define __HAVE_ARCH_STRCMP     /* arch function */
 #define __HAVE_ARCH_STRCPY     /* inline & arch function */
 #define __HAVE_ARCH_STRLCAT    /* arch function */
-#define __HAVE_ARCH_STRLCPY    /* arch function */
 #define __HAVE_ARCH_STRLEN     /* inline & arch function */
 #define __HAVE_ARCH_STRNCAT    /* arch function */
 #define __HAVE_ARCH_STRNCPY    /* arch function */
@@ -42,7 +41,6 @@ void *memmove(void *dest, const void *src, size_t n);
 int memcmp(const void *s1, const void *s2, size_t n);
 int strcmp(const char *s1, const char *s2);
 size_t strlcat(char *dest, const char *src, size_t n);
-size_t strlcpy(char *dest, const char *src, size_t size);
 char *strncat(char *dest, const char *src, size_t n);
 char *strncpy(char *dest, const char *src, size_t n);
 char *strstr(const char *s1, const char *s2);
index 4c2d1a8949cca2aa7727eaf7f03e45b6d6adbfec..d1955eabda28958dbe52f2137fe61db79d9035fc 100644 (file)
@@ -97,32 +97,6 @@ char *strcpy(char *dest, const char *src)
 EXPORT_SYMBOL(strcpy);
 #endif
 
-/**
- * strlcpy - Copy a %NUL terminated string into a sized buffer
- * @dest: Where to copy the string to
- * @src: Where to copy the string from
- * @size: size of destination buffer
- *
- * Compatible with *BSD: the result is always a valid
- * NUL-terminated string that fits in the buffer (unless,
- * of course, the buffer size is zero). It does not pad
- * out the result like strncpy() does.
- */
-#ifdef __HAVE_ARCH_STRLCPY
-size_t strlcpy(char *dest, const char *src, size_t size)
-{
-       size_t ret = __strend(src) - src;
-
-       if (size) {
-               size_t len = (ret >= size) ? size-1 : ret;
-               dest[len] = '\0';
-               memcpy(dest, src, len);
-       }
-       return ret;
-}
-EXPORT_SYMBOL(strlcpy);
-#endif
-
 /**
  * strncpy - Copy a length-limited, %NUL-terminated string
  * @dest: Where to copy the string to
This page took 0.057269 seconds and 4 git commands to generate.