m68k: remove arch specific non-optimized memcmp()
The m68k arch implements its own memcmp() function. It is not optimized
in any way (it is the most strait forward coding of memcmp you can get).
Remove it and use the kernels standard memcmp() implementation.
This also goes part of the way to fixing a regression caused by commit
ea61bc461d
("m68k/m68knommu: merge MMU and
non-MMU string.h"), which breaks non-coldfire non-mmu builds (which is
the 68x328 and 68360 families). They currently have no memcmp() function
defined, since there is none in the m68knommu/lib functions.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
b3e338de7e
commit
f9d693d237
2 changed files with 2 additions and 15 deletions
|
@ -102,12 +102,10 @@ static inline int strcmp(const char *cs, const char *ct)
|
||||||
|
|
||||||
#define __HAVE_ARCH_MEMMOVE
|
#define __HAVE_ARCH_MEMMOVE
|
||||||
extern void *memmove(void *, const void *, __kernel_size_t);
|
extern void *memmove(void *, const void *, __kernel_size_t);
|
||||||
|
|
||||||
#define __HAVE_ARCH_MEMCMP
|
|
||||||
extern int memcmp(const void *, const void *, __kernel_size_t);
|
|
||||||
#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
|
|
||||||
#endif /* CONFIG_COLDFIRE */
|
#endif /* CONFIG_COLDFIRE */
|
||||||
|
|
||||||
|
#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
|
||||||
|
|
||||||
#define __HAVE_ARCH_MEMSET
|
#define __HAVE_ARCH_MEMSET
|
||||||
extern void *memset(void *, int, __kernel_size_t);
|
extern void *memset(void *, int, __kernel_size_t);
|
||||||
#define memset(d, c, n) __builtin_memset(d, c, n)
|
#define memset(d, c, n) __builtin_memset(d, c, n)
|
||||||
|
|
|
@ -243,14 +243,3 @@ void *memmove(void *dest, const void *src, size_t n)
|
||||||
return xdest;
|
return xdest;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(memmove);
|
EXPORT_SYMBOL(memmove);
|
||||||
|
|
||||||
int memcmp(const void *cs, const void *ct, size_t count)
|
|
||||||
{
|
|
||||||
const unsigned char *su1, *su2;
|
|
||||||
|
|
||||||
for (su1 = cs, su2 = ct; count > 0; ++su1, ++su2, count--)
|
|
||||||
if (*su1 != *su2)
|
|
||||||
return *su1 < *su2 ? -1 : +1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(memcmp);
|
|
||||||
|
|
Loading…
Reference in a new issue