diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2010-05-24 17:33:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:07:05 -0400 |
commit | 903788892ea0fc7fcaf7e8e5fac9a77379fc215b (patch) | |
tree | 6945c6e623bf6fec7cdcd895a881c4d5bf405fa6 /include | |
parent | db0fd97c270f1e80321f7ae55234643ca0978c54 (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.
[akpm@linux-foundation.org: use tolower(), saving 3 bytes, test the more common case first - it's quicker]
[akpm@linux-foundation.org: relocate tolower to make it even faster! (Joe)]
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: "Richard Russon (FlatCap)" <ldm@flatcap.org>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernel.h | 2 |
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) | |||
375 | return buf; | 375 | return buf; |
376 | } | 376 | } |
377 | 377 | ||
378 | extern int hex_to_bin(char ch); | ||
379 | |||
378 | #ifndef pr_fmt | 380 | #ifndef pr_fmt |
379 | #define pr_fmt(fmt) fmt | 381 | #define pr_fmt(fmt) fmt |
380 | #endif | 382 | #endif |