lkml.org 
[lkml]   [2010]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[resend][PATCH] fs: use kernel's hex_to_bin() method
Date
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
---
fs/binfmt_misc.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 1befe2e..a0fb271 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -28,6 +28,7 @@
#include <linux/mount.h>
#include <linux/syscalls.h>
#include <linux/fs.h>
+#include <linux/kernel.h>

#include <asm/uaccess.h>

@@ -244,10 +245,8 @@ static int unquote(char *from)
while ((c = *s++) != '\0') {
if (c == '\\' && *s == 'x') {
s++;
- c = toupper(*s++);
- *p = (c - (isdigit(c) ? '0' : 'A' - 10)) << 4;
- c = toupper(*s++);
- *p++ |= c - (isdigit(c) ? '0' : 'A' - 10);
+ *p = hex_to_bin(*s++) << 4;
+ *p++ |= hex_to_bin(*s++);
continue;
}
*p++ = c;
--
1.7.2.3


\
 
 \ /
  Last update: 2010-12-10 11:57    [W:0.055 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site