From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: [PATCH] fs: use kernel's hex_to_bin() method Date: Wed, 11 Aug 2010 17:21:03 +0300 Message-ID: <1281536463-10680-1-git-send-email-andy.shevchenko@gmail.com> Cc: Andy Shevchenko , Alexander Viro , linux-fsdevel@vger.kernel.org To: linux-kernel@vger.kernel.org Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Signed-off-by: Andy Shevchenko Cc: Alexander Viro 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 9e60fd2..6c3855e 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -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.1.1