Skip to content

Commit f492bac

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/string: use generic strlcpy
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]>
1 parent eec013b commit f492bac

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

arch/s390/include/asm/string.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ void *memmove(void *dest, const void *src, size_t n);
3131
#define __HAVE_ARCH_STRCMP /* arch function */
3232
#define __HAVE_ARCH_STRCPY /* inline & arch function */
3333
#define __HAVE_ARCH_STRLCAT /* arch function */
34-
#define __HAVE_ARCH_STRLCPY /* arch function */
3534
#define __HAVE_ARCH_STRLEN /* inline & arch function */
3635
#define __HAVE_ARCH_STRNCAT /* arch function */
3736
#define __HAVE_ARCH_STRNCPY /* arch function */
@@ -42,7 +41,6 @@ void *memmove(void *dest, const void *src, size_t n);
4241
int memcmp(const void *s1, const void *s2, size_t n);
4342
int strcmp(const char *s1, const char *s2);
4443
size_t strlcat(char *dest, const char *src, size_t n);
45-
size_t strlcpy(char *dest, const char *src, size_t size);
4644
char *strncat(char *dest, const char *src, size_t n);
4745
char *strncpy(char *dest, const char *src, size_t n);
4846
char *strstr(const char *s1, const char *s2);

arch/s390/lib/string.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,6 @@ char *strcpy(char *dest, const char *src)
9797
EXPORT_SYMBOL(strcpy);
9898
#endif
9999

100-
/**
101-
* strlcpy - Copy a %NUL terminated string into a sized buffer
102-
* @dest: Where to copy the string to
103-
* @src: Where to copy the string from
104-
* @size: size of destination buffer
105-
*
106-
* Compatible with *BSD: the result is always a valid
107-
* NUL-terminated string that fits in the buffer (unless,
108-
* of course, the buffer size is zero). It does not pad
109-
* out the result like strncpy() does.
110-
*/
111-
#ifdef __HAVE_ARCH_STRLCPY
112-
size_t strlcpy(char *dest, const char *src, size_t size)
113-
{
114-
size_t ret = __strend(src) - src;
115-
116-
if (size) {
117-
size_t len = (ret >= size) ? size-1 : ret;
118-
dest[len] = '\0';
119-
memcpy(dest, src, len);
120-
}
121-
return ret;
122-
}
123-
EXPORT_SYMBOL(strlcpy);
124-
#endif
125-
126100
/**
127101
* strncpy - Copy a length-limited, %NUL-terminated string
128102
* @dest: Where to copy the string to

0 commit comments

Comments
 (0)