aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2010-05-24 14:33:23 -0700
committerLinus Torvalds <[email protected]>2010-05-25 08:07:05 -0700
commit903788892ea0fc7fcaf7e8e5fac9a77379fc215b (patch)
tree6945c6e623bf6fec7cdcd895a881c4d5bf405fa6 /include/linux
parentdb0fd97c270f1e80321f7ae55234643ca0978c54 (diff)
lib: introduce common method to convert hex digits
hex_to_bin() is a little method which converts hex digit to its actual value. There are plenty of places where such functionality is needed. [[email protected]: use tolower(), saving 3 bytes, test the more common case first - it's quicker] [[email protected]: relocate tolower to make it even faster! (Joe)] Signed-off-by: Andy Shevchenko <[email protected]> Cc: Tilman Schmidt <[email protected]> Cc: Duncan Sands <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "Richard Russon (FlatCap)" <[email protected]> Cc: John W. Linville <[email protected]> Cc: Len Brown <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kernel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 05f332afc9e0..8317ec4b9f3b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -375,6 +375,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
return buf;
}
+extern int hex_to_bin(char ch);
+
#ifndef pr_fmt
#define pr_fmt(fmt) fmt
#endif