Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Remove own implementation of hex_to_bin().

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andy Shevchenko and committed by
Linus Torvalds
69e4469a 96b89f32

+3 -6
+3 -6
kernel/sysctl_binary.c
··· 13 13 #include <linux/file.h> 14 14 #include <linux/ctype.h> 15 15 #include <linux/netdevice.h> 16 + #include <linux/kernel.h> 16 17 #include <linux/slab.h> 17 18 18 19 #ifdef CONFIG_SYSCTL_SYSCALL ··· 1125 1124 return result; 1126 1125 } 1127 1126 1128 - static unsigned hex_value(int ch) 1129 - { 1130 - return isdigit(ch) ? ch - '0' : ((ch | 0x20) - 'a') + 10; 1131 - } 1132 - 1133 1127 static ssize_t bin_uuid(struct file *file, 1134 1128 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) 1135 1129 { ··· 1152 1156 if (!isxdigit(str[0]) || !isxdigit(str[1])) 1153 1157 goto out; 1154 1158 1155 - uuid[i] = (hex_value(str[0]) << 4) | hex_value(str[1]); 1159 + uuid[i] = (hex_to_bin(str[0]) << 4) | 1160 + hex_to_bin(str[1]); 1156 1161 str += 2; 1157 1162 if (*str == '-') 1158 1163 str++;