backports: add crypto_memneq()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 11 Oct 2017 14:30:27 +0000 (16:30 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 11 Oct 2017 15:00:42 +0000 (17:00 +0200)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/crypto/algapi.h [new file with mode: 0644]
backport/compat/Makefile
copy-list

diff --git a/backport/backport-include/crypto/algapi.h b/backport/backport-include/crypto/algapi.h
new file mode 100644 (file)
index 0000000..b6fbdd9
--- /dev/null
@@ -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 */
index 1078357fd04b10b875bc5bd81ae3ba6831a204bd..1658f588c68f79e53a8dba2fb58bda90baa34da6 100644 (file)
@@ -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
index 88e91c6171250f2ad3c91e2e42f8c6ae39a3c533..678ebe2f59fc9e8c4819b219c65451a9dfe2741b 100644 (file)
--- 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