Skip to content

Commit e7b3f9a

Browse files
committed
s390/string: Remove optimized strncpy()
There are hardly any strncpy() users left, therefore drop the optimized s390 variant. Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 1c745df commit e7b3f9a

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

arch/s390/include/asm/string.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ void *memmove(void *dest, const void *src, size_t n);
3030
#define __HAVE_ARCH_STRLCAT /* arch function */
3131
#define __HAVE_ARCH_STRLEN /* inline & arch function */
3232
#define __HAVE_ARCH_STRNCAT /* arch function */
33-
#define __HAVE_ARCH_STRNCPY /* arch function */
3433
#define __HAVE_ARCH_STRNLEN /* inline & arch function */
3534
#define __HAVE_ARCH_STRSTR /* arch function */
3635
#define __HAVE_ARCH_MEMSET16 /* arch function */
@@ -42,7 +41,6 @@ int memcmp(const void *s1, const void *s2, size_t n);
4241
int strcmp(const char *s1, const char *s2);
4342
size_t strlcat(char *dest, const char *src, size_t n);
4443
char *strncat(char *dest, const char *src, size_t n);
45-
char *strncpy(char *dest, const char *src, size_t n);
4644
char *strstr(const char *s1, const char *s2);
4745
#endif /* !defined(CONFIG_KASAN) && !defined(CONFIG_KMSAN) */
4846

arch/s390/lib/string.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -101,26 +101,6 @@ char *strcpy(char *dest, const char *src)
101101
EXPORT_SYMBOL(strcpy);
102102
#endif
103103

104-
/**
105-
* strncpy - Copy a length-limited, %NUL-terminated string
106-
* @dest: Where to copy the string to
107-
* @src: Where to copy the string from
108-
* @n: The maximum number of bytes to copy
109-
*
110-
* The result is not %NUL-terminated if the source exceeds
111-
* @n bytes.
112-
*/
113-
#ifdef __HAVE_ARCH_STRNCPY
114-
char *strncpy(char *dest, const char *src, size_t n)
115-
{
116-
size_t len = __strnend(src, n) - src;
117-
memset(dest + len, 0, n - len);
118-
memcpy(dest, src, len);
119-
return dest;
120-
}
121-
EXPORT_SYMBOL(strncpy);
122-
#endif
123-
124104
/**
125105
* strcat - Append one %NUL-terminated string to another
126106
* @dest: The string to be appended to
@@ -181,9 +161,6 @@ EXPORT_SYMBOL(strlcat);
181161
* @n: The maximum numbers of bytes to copy
182162
*
183163
* returns a pointer to @dest
184-
*
185-
* Note that in contrast to strncpy, strncat ensures the result is
186-
* terminated.
187164
*/
188165
#ifdef __HAVE_ARCH_STRNCAT
189166
char *strncat(char *dest, const char *src, size_t n)

0 commit comments

Comments
 (0)