提交 69e4469a 编写于 作者: A Andy Shevchenko 提交者: Linus Torvalds

sysctl: don't use own implementation of hex_to_bin()

Remove own implementation of hex_to_bin().
Signed-off-by: NAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 96b89f32
......@@ -13,6 +13,7 @@
#include <linux/file.h>
#include <linux/ctype.h>
#include <linux/netdevice.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#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++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册