summaryrefslogtreecommitdiff
path: root/compat/backport-3.2.c
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2018-09-14 10:41:12 +0200
committerDominik Sliwa <dominik.sliwa@toradex.com>2018-09-14 10:41:12 +0200
commit6142e8731c3e5b9c9f96d9af83052b9787604b39 (patch)
tree45b17840142b10874bf8974a74152eb3f9021e82 /compat/backport-3.2.c
initial commit
Generated againts 4.18 kernel source with git backports 0795d050c62e04c7c4fd7fcb554756e6adb4ec64 Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'compat/backport-3.2.c')
-rw-r--r--compat/backport-3.2.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/compat/backport-3.2.c b/compat/backport-3.2.c
new file mode 100644
index 0000000..601a168
--- /dev/null
+++ b/compat/backport-3.2.c
@@ -0,0 +1,25 @@
+/*
+ * Linux backport symbols for kernels 3.2.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/export.h>
+
+int hex2bin(u8 *dst, const char *src, size_t count)
+{
+ while (count--) {
+ int hi = hex_to_bin(*src++);
+ int lo = hex_to_bin(*src++);
+
+ if ((hi < 0) || (lo < 0))
+ return -1;
+
+ *dst++ = (hi << 4) | lo;
+ }
+ return 0;
+}
+EXPORT_SYMBOL_GPL(hex2bin);