mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
To: linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 06/10] sysctl: don't use own implementation of hex_to_bin()
Date: Fri, 30 Apr 2010 12:34:05 +0300	[thread overview]
Message-ID: <7cd86c01ad4a376fb8a48ffe307ce7c0510cecc0.1272617852.git.ext-andriy.shevchenko@nokia.com> (raw)
In-Reply-To: <2eb558b7b0b20dfea0b61223db6146cb8fdbe52d.1272617852.git.ext-andriy.shevchenko@nokia.com>
In-Reply-To: <cover.1272617852.git.ext-andriy.shevchenko@nokia.com>

Get rid of own implementation of hex_to_bin().

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 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 <linux/file.h>
 #include <linux/ctype.h>
 #include <linux/netdevice.h>
+#include <linux/kernel.h>
 #include <linux/slab.h>
 
 #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


  reply	other threads:[~2010-04-30 18:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30  9:33 [PATCH 00/10] Introduce common hex_to_bin() helper Andy Shevchenko
2010-04-30  9:34 ` [PATCH 01/10] lib: introduce common method to convert hex digits Andy Shevchenko
2010-04-30  9:34   ` [PATCH 02/10] drivers: isdn: use new hex_to_bin() method Andy Shevchenko
2010-04-30  9:34     ` [PATCH 03/10] usb: atm: speedtch: " Andy Shevchenko
2010-04-30  9:34       ` [PATCH 04/10] drivers: net: " Andy Shevchenko
2010-04-30  9:34         ` [PATCH 05/10] " Andy Shevchenko
2010-04-30  9:34           ` Andy Shevchenko [this message]
2010-04-30  9:34             ` [PATCH 07/10] staging: rt2860: " Andy Shevchenko
2010-04-30  9:34               ` [PATCH 08/10] fs: ldm: don't use own implementation of hex_to_bin() Andy Shevchenko
2010-04-30  9:34                 ` [PATCH 09/10] drivers: wireless: use new hex_to_bin() method Andy Shevchenko
2010-04-30  9:34                   ` [PATCH 10/10] drivers: acpi: don't use own implementation of hex_to_bin() Andy Shevchenko
2010-04-30 18:14                   ` [PATCH 09/10] drivers: wireless: use new hex_to_bin() method John W. Linville
2010-05-04  0:14           ` [PATCH 05/10] drivers: net: " Divy Le Ray
2010-04-30 19:07   ` [PATCH 01/10] lib: introduce common method to convert hex digits Andrew Morton
2010-05-01  2:55     ` Joe Perches
2010-05-02 18:12     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cd86c01ad4a376fb8a48ffe307ce7c0510cecc0.1272617852.git.ext-andriy.shevchenko@nokia.com \
    --to=ext-andriy.shevchenko@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®