From: Johannes Berg <johannes@sipsolutions.net>
To: backports@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 4/5] backports: add bin2hex()
Date: Thu, 12 Oct 2017 23:00:24 +0200 [thread overview]
Message-ID: <20171012210025.7490-4-johannes@sipsolutions.net> (raw)
In-Reply-To: <20171012210025.7490-1-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
backport/backport-include/linux/kernel.h | 5 +++++
backport/compat/backport-3.18.c | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index ea55d7d3b143..0d625313f5fb 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -211,6 +211,11 @@ static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
}
#endif /* LINUX_VERSION_IS_LESS(3,14,0) */
+#if LINUX_VERSION_IS_LESS(3,18,0)
+#define bin2hex LINUX_BACKPORT(bin2hex)
+extern char *bin2hex(char *dst, const void *src, size_t count);
+#endif
+
#endif /* __BACKPORT_KERNEL_H */
/*
diff --git a/backport/compat/backport-3.18.c b/backport/compat/backport-3.18.c
index 73db233cb22b..d2eceef7dc77 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);
--
2.14.2
--
To unsubscribe from this list: send the line "unsubscribe backports" in
next prev parent reply other threads:[~2017-10-12 21:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 21:00 [PATCH 1/5] backports: move headers to be clearer Johannes Berg
2017-10-12 21:00 ` [PATCH 2/5] backports: add mktime64() Johannes Berg
2017-10-12 21:00 ` [PATCH 3/5] copy-list: move mpls includes Johannes Berg
2017-10-12 21:00 ` Johannes Berg [this message]
2017-10-13 8:55 ` [PATCH 4/5] backports: add bin2hex() Arend van Spriel
2017-10-13 8:56 ` Johannes Berg
2017-10-12 21:00 ` [PATCH 5/5] backports: add signature verification code Johannes Berg
2017-10-12 21:42 ` Johannes Berg
2017-10-12 22:05 ` Johannes Berg
2017-10-13 6:00 ` Johannes Berg
2017-10-13 9:02 ` Arend van Spriel
2017-10-13 9:09 ` Johannes Berg
2017-10-13 9:10 ` Johannes Berg
2017-10-13 9:36 ` Arend van Spriel
2017-10-13 9:38 ` Johannes Berg
2017-10-13 9:39 ` Johannes Berg
2017-10-13 10:22 ` Arend van Spriel
2017-10-13 10:23 ` Johannes Berg
2017-10-13 8:56 ` [PATCH 1/5] backports: move headers to be clearer Arend van Spriel
2017-10-13 8:57 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171012210025.7490-4-johannes@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=backports@vger.kernel.org \
--cc=johannes.berg@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox