Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759256Ab0D3Stq (ORCPT ); Fri, 30 Apr 2010 14:49:46 -0400 Received: from smtp.nokia.com ([192.100.122.230]:61905 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932817Ab0D3RNN (ORCPT ); Fri, 30 Apr 2010 13:13:13 -0400 From: Andy Shevchenko To: linux-kernel@vger.kernel.org Cc: Andy Shevchenko , "Eric W. Biederman" , Andrew Morton Subject: [PATCH 06/10] sysctl: don't use own implementation of hex_to_bin() Date: Fri, 30 Apr 2010 12:34:05 +0300 Message-Id: <7cd86c01ad4a376fb8a48ffe307ce7c0510cecc0.1272617852.git.ext-andriy.shevchenko@nokia.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <2eb558b7b0b20dfea0b61223db6146cb8fdbe52d.1272617852.git.ext-andriy.shevchenko@nokia.com> References: <1a326db89859eec030859e4905c515e0817bd2ea.1272617852.git.ext-andriy.shevchenko@nokia.com> <2eb558b7b0b20dfea0b61223db6146cb8fdbe52d.1272617852.git.ext-andriy.shevchenko@nokia.com> In-Reply-To: References: X-OriginalArrivalTime: 30 Apr 2010 09:34:06.0773 (UTC) FILETIME=[4776AE50:01CAE848] X-Nokia-AV: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1470 Lines: 51 Get rid of own implementation of hex_to_bin(). Signed-off-by: Andy Shevchenko Cc: Eric W. Biederman Cc: Andrew Morton --- kernel/sysctl_binary.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index 5903057..f4789ed 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #ifdef CONFIG_SYSCTL_SYSCALL @@ -1125,11 +1126,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) { @@ -1157,7 +1153,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++; -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/