summaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-04-09 08:39:36 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-09 08:39:36 +0200
commit310655b07ae8ef0b8fdb641b610ded2052215664 (patch)
treed9b7a500ef21a087a337e1f1bb9218000cf1c03d /lib/string.c
parentethtool: thunder_bgx: use ethtool.h constants for speed and duplex (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadlinux-310655b07ae8ef0b8fdb641b610ded2052215664.tar.xz
linux-310655b07ae8ef0b8fdb641b610ded2052215664.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c
index 38e4ca08e757..3ab861c1a857 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -866,6 +866,26 @@ __visible int memcmp(const void *cs, const void *ct, size_t count)
EXPORT_SYMBOL(memcmp);
#endif
+#ifndef __HAVE_ARCH_BCMP
+/**
+ * bcmp - returns 0 if and only if the buffers have identical contents.
+ * @a: pointer to first buffer.
+ * @b: pointer to second buffer.
+ * @len: size of buffers.
+ *
+ * The sign or magnitude of a non-zero return value has no particular
+ * meaning, and architectures may implement their own more efficient bcmp(). So
+ * while this particular implementation is a simple (tail) call to memcmp, do
+ * not rely on anything but whether the return value is zero or non-zero.
+ */
+#undef bcmp
+int bcmp(const void *a, const void *b, size_t len)
+{
+ return memcmp(a, b, len);
+}
+EXPORT_SYMBOL(bcmp);
+#endif
+
#ifndef __HAVE_ARCH_MEMSCAN
/**
* memscan - Find a character in an area of memory.