From: Andy Shevchenko Date: Mon, 24 May 2010 21:33:26 +0000 (-0700) Subject: sysctl: don't use own implementation of hex_to_bin() X-Git-Tag: 2.1b_release~8214 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69e4469a39b67e9923731d5d77d45c04837d5def;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git sysctl: don't use own implementation of hex_to_bin() Remove own implementation of hex_to_bin(). Signed-off-by: Andy Shevchenko Cc: Eric W. Biederman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index 937d31d..1357c57 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #ifdef CONFIG_SYSCTL_SYSCALL @@ -1124,11 +1125,6 @@ out: return result; } -static unsigned hex_value(int ch) -{ - return isdigit(ch) ? ch - '0' : ((ch | 0x20) - 'a') + 10; -} - static ssize_t bin_uuid(struct file *file, void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) { @@ -1156,7 +1152,8 @@ static ssize_t bin_uuid(struct file *file, if (!isxdigit(str[0]) || !isxdigit(str[1])) goto out; - uuid[i] = (hex_value(str[0]) << 4) | hex_value(str[1]); + uuid[i] = (hex_to_bin(str[0]) << 4) | + hex_to_bin(str[1]); str += 2; if (*str == '-') str++;