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/xtensa | |
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/xtensa')
-rw-r--r-- | arch/xtensa/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/xtensa/lib/strcasecmp.c | 32 |
2 files changed, 1 insertions, 33 deletions
diff --git a/arch/xtensa/lib/Makefile b/arch/xtensa/lib/Makefile index ed935b58e8a4..6c4fdd86acd8 100644 --- a/arch/xtensa/lib/Makefile +++ b/arch/xtensa/lib/Makefile | |||
@@ -2,6 +2,6 @@ | |||
2 | # Makefile for Xtensa-specific library files. | 2 | # Makefile for Xtensa-specific library files. |
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y += memcopy.o memset.o checksum.o strcasecmp.o \ | 5 | lib-y += memcopy.o memset.o checksum.o \ |
6 | usercopy.o strncpy_user.o strnlen_user.o | 6 | usercopy.o strncpy_user.o strnlen_user.o |
7 | lib-$(CONFIG_PCI) += pci-auto.o | 7 | lib-$(CONFIG_PCI) += pci-auto.o |
diff --git a/arch/xtensa/lib/strcasecmp.c b/arch/xtensa/lib/strcasecmp.c deleted file mode 100644 index 165b2d6effa5..000000000000 --- a/arch/xtensa/lib/strcasecmp.c +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/xtensa/lib/strcasecmp.c | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2002 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #include <linux/string.h> | ||
12 | |||
13 | |||
14 | /* We handle nothing here except the C locale. Since this is used in | ||
15 | only one place, on strings known to contain only 7 bit ASCII, this | ||
16 | is ok. */ | ||
17 | |||
18 | int strcasecmp(const char *a, const char *b) | ||
19 | { | ||
20 | int ca, cb; | ||
21 | |||
22 | do { | ||
23 | ca = *a++ & 0xff; | ||
24 | cb = *b++ & 0xff; | ||
25 | if (ca >= 'A' && ca <= 'Z') | ||
26 | ca += 'a' - 'A'; | ||
27 | if (cb >= 'A' && cb <= 'Z') | ||
28 | cb += 'a' - 'A'; | ||
29 | } while (ca == cb && ca != '\0'); | ||
30 | |||
31 | return ca - cb; | ||
32 | } | ||