diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-13 08:23:30 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-19 07:50:21 +0100 |
commit | df4b6f133b5e63d33e1029b21cd6998ff51b5be3 (patch) | |
tree | aa9300832ca57f9cf40d9d226a9e4116099b51ac /include | |
parent | 1f91b3e6da8226646fe4aa2f90a60c43c4935345 (diff) | |
download | barebox-df4b6f133b5e63d33e1029b21cd6998ff51b5be3.tar.gz barebox-df4b6f133b5e63d33e1029b21cd6998ff51b5be3.tar.xz |
lib: Add hex2bin and bin2hex implementations
Taken from the Kernel, put into the same place as in the kernel,
although the hexdump.c does not actually contain hexdum functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernel.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5b6b448395..945e063f02 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -246,6 +246,10 @@ static inline char *hex_byte_pack_upper(char *buf, u8 byte) return buf; } +extern int hex_to_bin(char ch); +extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); +extern char *bin2hex(char *dst, const void *src, size_t count); + /** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member. |