[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1272682556.1648.101.camel@Joe-Laptop.home>
Date: Fri, 30 Apr 2010 19:55:56 -0700
From: Joe Perches <joe@...ches.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/10] lib: introduce common method to convert hex
digits
On Fri, 2010-04-30 at 12:07 -0700, Andrew Morton wrote:
> I had to fiddle with it:
> - use tolower(), saving 3 bytes!
tolower could be done after the 0-9 case as well
int hex_to_bin(char ch)
{
if ((ch >= '0') && (ch <= '9'))
return ch - '0';
ch = tolower(ch);
if ((ch >= 'a') && (ch <= 'f'))
return ch - 'a' + 10;
return -1;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists