diff mbox

[5/5] backports: add crypto_memneq()

Message ID 20171011143147.3337-5-johannes@sipsolutions.net (mailing list archive)
State Accepted
Headers show

Commit Message

Johannes Berg Oct. 11, 2017, 2:31 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/crypto/algapi.h | 16 ++++++++++++++++
 backport/compat/Makefile                  |  2 +-
 copy-list                                 |  3 +++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 backport/backport-include/crypto/algapi.h
diff mbox

Patch

diff --git a/backport/backport-include/crypto/algapi.h b/backport/backport-include/crypto/algapi.h
new file mode 100644
index 000000000000..b6fbdd9bf224
--- /dev/null
+++ b/backport/backport-include/crypto/algapi.h
@@ -0,0 +1,16 @@ 
+#ifndef __BP_ALGAPI_H
+#define __BP_ALGAPI_H
+#include <linux/version.h>
+#include_next <crypto/algapi.h>
+
+#if LINUX_VERSION_IS_LESS(3,13,0)
+#define __crypto_memneq LINUX_BACKPORT(__crypto_memneq)
+noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size);
+#define crypto_memneq LINUX_BACKPORT(crypto_memneq)
+static inline int crypto_memneq(const void *a, const void *b, size_t size)
+{
+        return __crypto_memneq(a, b, size) != 0UL ? 1 : 0;
+}
+#endif
+
+#endif /* __BP_ALGAPI_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 1078357fd04b..1658f588c68f 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -20,7 +20,7 @@  compat-$(CPTCFG_KERNEL_3_9) += compat-3.9.o
 compat-$(CPTCFG_KERNEL_3_10) += backport-3.10.o
 compat-$(CPTCFG_KERNEL_3_11) += backport-3.11.o
 compat-$(CPTCFG_KERNEL_3_12) += backport-3.12.o
-compat-$(CPTCFG_KERNEL_3_13) += backport-3.13.o
+compat-$(CPTCFG_KERNEL_3_13) += backport-3.13.o memneq.o
 compat-$(CPTCFG_KERNEL_3_14) += backport-3.14.o
 compat-$(CPTCFG_KERNEL_3_15) += backport-3.15.o
 compat-$(CPTCFG_KERNEL_3_17) += backport-3.17.o
diff --git a/copy-list b/copy-list
index 88e91c617125..678ebe2f59fc 100644
--- a/copy-list
+++ b/copy-list
@@ -20,6 +20,9 @@  include/linux/fixp-arith.h
 include/linux/bitfield.h
 include/linux/average.h
 
+# crypto_memneq
+crypto/memneq.c -> compat/memneq.c
+
 # 802.11
 drivers/net/wireless/Kconfig
 drivers/net/wireless/Makefile