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

From: Thiago Farina
Date: Mon Aug 02 2010 - 14:00:20 EST


On Mon, Aug 2, 2010 at 2:56 PM, Thiago Farina <tfransosi@xxxxxxxxx> wrote:
> On Mon, Aug 2, 2010 at 4:13 AM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote:
>> Index: linux-2.6/arch/x86/boot/string.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/boot/string.c
>> +++ linux-2.6/arch/x86/boot/string.c
>> @@ -12,7 +12,21 @@
>> Â* Very basic string functions
>> Â*/
>>
>> -#include "boot.h"
>> +static inline int isdigit(int ch)
>> +{
>> + Â Â Â return (ch >= '0') && (ch <= '9');
>> +}
>> +
>> +static inline int isxdigit(int ch)
>> +{
>> + Â Â Â if (isdigit(ch))
>> + Â Â Â Â Â Â Â return true;
>> +
>> + Â Â Â if ((ch >= 'a') && (ch <= 'f'))
>> + Â Â Â Â Â Â Â return true;
>> +
>> + Â Â Â return (ch >= 'A') && (ch <= 'F');
>> +}
>>
>
> 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');
> }
>

Wow, sorry, this should be:

static inline bool is_hex_digit(int c) { ... }
--
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/