diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-29 04:18:42 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 04:54:39 -0400 |
commit | ded220bd8f0823771fc0a9bdf7f5bcbe543197b6 (patch) | |
tree | 530854859821c51cb3bcd9092140c535153627e5 /arch/sh | |
parent | 357418e7cac16fed4ca558c6037d189d2109c9c2 (diff) |
[STRING]: Move strcasecmp/strncasecmp to lib/string.c
We have several platforms using local copies of identical
code.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/lib/strcasecmp.c | 26 |
2 files changed, 1 insertions, 27 deletions
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index b5681e3f9684..0b9cca5c7cb4 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y = delay.o memset.o memmove.o memchr.o \ | 5 | lib-y = delay.o memset.o memmove.o memchr.o \ |
6 | checksum.o strcasecmp.o strlen.o div64.o udivdi3.o \ | 6 | checksum.o strlen.o div64.o udivdi3.o \ |
7 | div64-generic.o | 7 | div64-generic.o |
8 | 8 | ||
9 | memcpy-y := memcpy.o | 9 | memcpy-y := memcpy.o |
diff --git a/arch/sh/lib/strcasecmp.c b/arch/sh/lib/strcasecmp.c deleted file mode 100644 index 4e57a216feaf..000000000000 --- a/arch/sh/lib/strcasecmp.c +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/alpha/lib/strcasecmp.c | ||
3 | */ | ||
4 | |||
5 | #include <linux/string.h> | ||
6 | |||
7 | |||
8 | /* We handle nothing here except the C locale. Since this is used in | ||
9 | only one place, on strings known to contain only 7 bit ASCII, this | ||
10 | is ok. */ | ||
11 | |||
12 | int strcasecmp(const char *a, const char *b) | ||
13 | { | ||
14 | int ca, cb; | ||
15 | |||
16 | do { | ||
17 | ca = *a++ & 0xff; | ||
18 | cb = *b++ & 0xff; | ||
19 | if (ca >= 'A' && ca <= 'Z') | ||
20 | ca += 'a' - 'A'; | ||
21 | if (cb >= 'A' && cb <= 'Z') | ||
22 | cb += 'a' - 'A'; | ||
23 | } while (ca == cb && ca != '\0'); | ||
24 | |||
25 | return ca - cb; | ||
26 | } | ||