Skip to content

Commit

Permalink
s390: cleanup string ops prototypes
Browse files Browse the repository at this point in the history
Just some trivial changes like removing the extern keyword from the
header file, renaming arguments to match the man pages, and whitespace
removal.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
heicarst authored and Martin Schwidefsky committed Oct 9, 2017
1 parent 993fef9 commit 49913f1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions arch/s390/include/asm/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
#define __HAVE_ARCH_STRSTR /* arch function */

/* Prototypes for non-inlined arch strings functions. */
extern int memcmp(const void *, const void *, size_t);
extern void *memcpy(void *, const void *, size_t);
extern void *memset(void *, int, size_t);
extern void *memmove(void *, const void *, size_t);
extern int strcmp(const char *,const char *);
extern size_t strlcat(char *, const char *, size_t);
extern size_t strlcpy(char *, const char *, size_t);
extern char *strncat(char *, const char *, size_t);
extern char *strncpy(char *, const char *, size_t);
extern char *strrchr(const char *, int);
extern char *strstr(const char *, const char *);
int memcmp(const void *s1, const void *s2, size_t n);
void *memcpy(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n);
void *memmove(void *dest, const void *src, 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 *strrchr(const char *s, int c);
char *strstr(const char *s1, const char *s2);

#undef __HAVE_ARCH_STRCHR
#undef __HAVE_ARCH_STRNCHR
Expand Down
28 changes: 14 additions & 14 deletions arch/s390/lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EXPORT_SYMBOL(strlen);
*
* returns the minimum of the length of @s and @n
*/
size_t strnlen(const char * s, size_t n)
size_t strnlen(const char *s, size_t n)
{
return __strnend(s, n) - s;
}
Expand Down Expand Up @@ -194,14 +194,14 @@ EXPORT_SYMBOL(strncat);

/**
* strcmp - Compare two strings
* @cs: One string
* @ct: Another string
* @s1: One string
* @s2: Another string
*
* returns 0 if @cs and @ct are equal,
* < 0 if @cs is less than @ct
* > 0 if @cs is greater than @ct
* returns 0 if @s1 and @s2 are equal,
* < 0 if @s1 is less than @s2
* > 0 if @s1 is greater than @s2
*/
int strcmp(const char *cs, const char *ct)
int strcmp(const char *s1, const char *s2)
{
register int r0 asm("0") = 0;
int ret = 0;
Expand All @@ -213,7 +213,7 @@ int strcmp(const char *cs, const char *ct)
" ic %1,0(%3)\n"
" sr %0,%1\n"
"1:"
: "+d" (ret), "+d" (r0), "+a" (cs), "+a" (ct)
: "+d" (ret), "+d" (r0), "+a" (s1), "+a" (s2)
: : "cc", "memory");
return ret;
}
Expand All @@ -224,7 +224,7 @@ EXPORT_SYMBOL(strcmp);
* @s: The string to be searched
* @c: The character to search for
*/
char * strrchr(const char * s, int c)
char *strrchr(const char *s, int c)
{
size_t len = __strend(s) - s;

Expand Down Expand Up @@ -260,7 +260,7 @@ static inline int clcle(const char *s1, unsigned long l1,
* @s1: The string to be searched
* @s2: The string to search for
*/
char * strstr(const char * s1,const char * s2)
char *strstr(const char *s1, const char *s2)
{
int l1, l2;

Expand Down Expand Up @@ -306,15 +306,15 @@ EXPORT_SYMBOL(memchr);

/**
* memcmp - Compare two areas of memory
* @cs: One area of memory
* @ct: Another area of memory
* @s1: One area of memory
* @s2: Another area of memory
* @count: The size of the area.
*/
int memcmp(const void *cs, const void *ct, size_t n)
int memcmp(const void *s1, const void *s2, size_t n)
{
int ret;

ret = clcle(cs, n, ct, n);
ret = clcle(s1, n, s2, n);
if (ret)
ret = ret == 1 ? -1 : 1;
return ret;
Expand Down

0 comments on commit 49913f1

Please sign in to comment.