From c3ace52175acf7650d284adf9a9137bca46d3df7 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 24 May 2010 14:33:26 -0700 Subject: [PATCH] --- yaml --- r: 198308 b: refs/heads/master c: 69e4469a39b67e9923731d5d77d45c04837d5def h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/sysctl_binary.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 31b566113091..3edfe61c0330 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 96b89f323d6af996a7f6bd84d2119cbf7145f9a4 +refs/heads/master: 69e4469a39b67e9923731d5d77d45c04837d5def diff --git a/trunk/kernel/sysctl_binary.c b/trunk/kernel/sysctl_binary.c index 937d31dc8566..1357c5786064 100644 --- a/trunk/kernel/sysctl_binary.c +++ b/trunk/kernel/sysctl_binary.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #ifdef CONFIG_SYSCTL_SYSCALL @@ -1124,11 +1125,6 @@ static ssize_t bin_ulongvec(struct file *file, 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++;