Skip to content

Commit

Permalink
[PATCH] Clean up arch-overrides in linux/string.h
Browse files Browse the repository at this point in the history
Some string functions were safely overrideable in lib/string.c, but their
corresponding declarations in linux/string.h were not.  Correct this, and
make strcspn overrideable.

Odds of someone wanting to do optimized assembly of these are small, but
for the sake of cleanliness, might as well bring them into line with the
rest of the file.

Signed-off-by: Kyle McMartin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Kyle McMartin authored and Linus Torvalds committed Apr 11, 2006
1 parent 894b577 commit 8833d32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 12 additions & 5 deletions include/linux/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
extern "C" {
#endif

extern char * strpbrk(const char *,const char *);
extern char * strsep(char **,const char *);
extern __kernel_size_t strspn(const char *,const char *);
extern __kernel_size_t strcspn(const char *,const char *);

extern char *strndup_user(const char __user *, long);

/*
Expand Down Expand Up @@ -70,6 +65,18 @@ extern __kernel_size_t strlen(const char *);
#ifndef __HAVE_ARCH_STRNLEN
extern __kernel_size_t strnlen(const char *,__kernel_size_t);
#endif
#ifndef __HAVE_ARCH_STRPBRK
extern char * strpbrk(const char *,const char *);
#endif
#ifndef __HAVE_ARCH_STRSEP
extern char * strsep(char **,const char *);
#endif
#ifndef __HAVE_ARCH_STRSPN
extern __kernel_size_t strspn(const char *,const char *);
#endif
#ifndef __HAVE_ARCH_STRCSPN
extern __kernel_size_t strcspn(const char *,const char *);
#endif

#ifndef __HAVE_ARCH_MEMSET
extern void * memset(void *,int,__kernel_size_t);
Expand Down
2 changes: 2 additions & 0 deletions lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ size_t strspn(const char *s, const char *accept)
EXPORT_SYMBOL(strspn);
#endif

#ifndef __HAVE_ARCH_STRCSPN
/**
* strcspn - Calculate the length of the initial substring of @s which does
* not contain letters in @reject
Expand All @@ -384,6 +385,7 @@ size_t strcspn(const char *s, const char *reject)
return count;
}
EXPORT_SYMBOL(strcspn);
#endif

#ifndef __HAVE_ARCH_STRPBRK
/**
Expand Down

0 comments on commit 8833d32

Please sign in to comment.