Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ded220bd authored by David S. Miller's avatar David S. Miller
Browse files

[STRING]: Move strcasecmp/strncasecmp to lib/string.c



We have several platforms using local copies of identical
code.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 357418e7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
	$(ev6-y)csum_ipv6_magic.o \
	$(ev6-y)clear_page.o \
	$(ev6-y)copy_page.o \
	strcasecmp.o \
	fpreg.o \
	callback_srm.o srm_puts.o srm_printk.o

arch/alpha/lib/strcasecmp.c

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
/*
 *  linux/arch/alpha/lib/strcasecmp.c
 */

#include <linux/string.h>


/* We handle nothing here except the C locale.  Since this is used in
   only one place, on strings known to contain only 7 bit ASCII, this
   is ok.  */

int strcasecmp(const char *a, const char *b)
{
	int ca, cb;

	do {
		ca = *a++ & 0xff;
		cb = *b++ & 0xff;
		if (ca >= 'A' && ca <= 'Z')
			ca += 'a' - 'A';
		if (cb >= 'A' && cb <= 'Z')
			cb += 'a' - 'A';
	} while (ca == cb && ca != '\0');

	return ca - cb;
}
+0 −2
Original line number Diff line number Diff line
@@ -84,8 +84,6 @@ EXPORT_SYMBOL(strncpy);
EXPORT_SYMBOL(strcat);
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(strcmp);
EXPORT_SYMBOL(strcasecmp);
EXPORT_SYMBOL(strncasecmp);

EXPORT_SYMBOL(csum_partial);
EXPORT_SYMBOL(csum_partial_copy_generic);
+2 −3
Original line number Diff line number Diff line
@@ -7,13 +7,12 @@ EXTRA_CFLAGS += -mno-minimal-toc
endif

ifeq ($(CONFIG_PPC_MERGE),y)
obj-y			:= string.o strcase.o
obj-y			:= string.o
obj-$(CONFIG_PPC32)	+= div64.o copy_32.o checksum_32.o
endif

obj-$(CONFIG_PPC64)	+= checksum_64.o copypage_64.o copyuser_64.o \
			   memcpy_64.o usercopy_64.o mem_64.o string.o \
			   strcase.o
			   memcpy_64.o usercopy_64.o mem_64.o string.o
obj-$(CONFIG_QUICC_ENGINE) += rheap.o
obj-$(CONFIG_XMON)	+= sstep.o
obj-$(CONFIG_KPROBES)	+= sstep.o

arch/powerpc/lib/strcase.c

deleted100644 → 0
+0 −25
Original line number Diff line number Diff line
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/string.h>

int strcasecmp(const char *s1, const char *s2)
{
	int c1, c2;

	do {
		c1 = tolower(*s1++);
		c2 = tolower(*s2++);
	} while (c1 == c2 && c1 != 0);
	return c1 - c2;
}

int strncasecmp(const char *s1, const char *s2, size_t n)
{
	int c1, c2;

	do {
		c1 = tolower(*s1++);
		c2 = tolower(*s2++);
	} while ((--n > 0) && c1 == c2 && c1 != 0);
	return c1 - c2;
}
Loading