backports: add bin2hex()
[openwrt/staging/blogic.git] / backport / compat / backport-3.18.c
index 73db233cb22b06fa8c98186f4159993f74140a1d..d2eceef7dc77732d74bdecd5c0106c411ab834eb 100644 (file)
@@ -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);