blob: 35ef1646286e6a8473a4b2b5380459ca7054259f [file] [log] [blame]
xjb04a4022021-11-25 15:01:52 +08001/*
2 * copied from linux/lib/string.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7#include <linux/module.h>
8#include <linux/string.h>
9
10#undef memcmp
11int memcmp(const void *cs, const void *ct, size_t count)
12{
13 const unsigned char *su1, *su2;
14 int res = 0;
15
16 for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
17 if ((res = *su1 - *su2) != 0)
18 break;
19 return res;
20}
21EXPORT_SYMBOL(memcmp);
22