Re: [PATCH 1/2] x86, setup: reorgize the early_console_setup

From: Thiago Farina
Date: Mon Aug 02 2010 - 15:09:39 EST


On Mon, Aug 2, 2010 at 3:27 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
> On 08/02/2010 10:56 AM, Thiago Farina wrote:
>>
>> These to functions above can be fairly simplified by writting as:
>>
>> static bool inline is_hex_digit(int c) {
>> Â return (c >= '0' && c <= '9') ||
>> Â Â Â Â Â Â (c >= 'A' && c <= 'F') ||
>> Â Â Â Â Â Â (c >= 'a' && c <= 'f');
>> }
>>
>
> a) You lose the isdigit() functionality, which is useful on its own.
> b) Does this enahance readability in any way?
> c) Your proposed renaming is nonstandard.
>

What about this instead?

static inline bool isxdigit(int ch) {
return (isdigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f');
}

> As such, I don't think this is a good idea.
>
> Â Â Â Â-hpa
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/