summaryrefslogtreecommitdiff
path: root/backport/compat
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-10-12 22:53:09 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-10-13 10:57:59 +0200
commitf82274f97829d7f9e11a9793546ba88b084e1199 (patch)
tree2ea5abfd736feb2d459b9a3a8c9569162286564f /backport/compat
parent40c06d6965547ad783cd22a5bd8d1f9e7cf5294b (diff)
backports: add bin2hex()
This is needed in the key backports in the next patch. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/compat')
-rw-r--r--backport/compat/backport-3.18.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/backport/compat/backport-3.18.c b/backport/compat/backport-3.18.c
index 73db233c..d2eceef7 100644
--- a/backport/compat/backport-3.18.c
+++ b/backport/compat/backport-3.18.c
@@ -320,3 +320,13 @@ void memzero_explicit(void *s, size_t count)
}
EXPORT_SYMBOL_GPL(memzero_explicit);
#endif
+
+char *bin2hex(char *dst, const void *src, size_t count)
+{
+ const unsigned char *_src = src;
+
+ while (count--)
+ dst = hex_byte_pack(dst, *_src++);
+ return dst;
+}
+EXPORT_SYMBOL(bin2hex);