Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754268Ab0BVSLZ (ORCPT ); Mon, 22 Feb 2010 13:11:25 -0500 Received: from smtp.nokia.com ([192.100.122.233]:26267 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754166Ab0BVSLO (ORCPT ); Mon, 22 Feb 2010 13:11:14 -0500 From: Andy Shevchenko To: linux-kernel@vger.kernel.org Cc: Andy Shevchenko , "Eric W. Biederman" , Andi Kleen Subject: [PATCH 07/11] sysctl: don't use own implementation of hex_to_bin() Date: Mon, 22 Feb 2010 20:09:06 +0200 Message-Id: <5c02662a55439f65791e24b8282d4face566955e.1266861291.git.ext-andriy.shevchenko@nokia.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <8470deda388af7015db44e96fa69560dd6e30126.1266861291.git.ext-andriy.shevchenko@nokia.com> References: <5627f8a3ddb2d746e58409d1d59338a99b77291a.1266861291.git.ext-andriy.shevchenko@nokia.com> <939cb3c63fbf6639b5d301ddc79c64d5642a6b81.1266861291.git.ext-andriy.shevchenko@nokia.com> <8470deda388af7015db44e96fa69560dd6e30126.1266861291.git.ext-andriy.shevchenko@nokia.com> In-Reply-To: References: X-OriginalArrivalTime: 22 Feb 2010 18:10:35.0595 (UTC) FILETIME=[549069B0:01CAB3EA] X-Nokia-AV: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1570 Lines: 54 From: Andy Shevchenko Get rid of own implementation of hex_to_bin(). It requires to have hex_to_bin() introduced by starter patch in the series. Signed-off-by: Andy Shevchenko Cc: Eric W. Biederman Cc: Andi Kleen --- 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 8f5d16e..e09c852 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c @@ -13,6 +13,7 @@ #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++; -- 1.5.6.5 -- 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/