Re: [PATCH] include/linux/skbuff.h: using '0xffff' instead of '~0U'

From: Chen Gang
Date: Mon Jun 03 2013 - 06:52:45 EST


On 06/03/2013 06:14 PM, Andy Shevchenko wrote:
> On Mon, Jun 3, 2013 at 12:23 PM, Chen Gang <gang.chen@xxxxxxxxxxx> wrote:
>> On 06/01/2013 05:05 AM, Andy Shevchenko wrote:
>
>>> Why not "(u16)~0" ?
>> We'd better to give a meaningful name to it just like Ben said.
>
> Yeah, you could give a name, though I don't see this needs for
> constants like (u16)~0. It's a usual way to mark some values
> uninitialized.
> Just an example from kernel:
>
> /* This is limited by 16 bit "slot" numbers,
> * and by available on-disk context storage.
> *
> * Also (u16)~0 is special (denotes a "free" extent).
>

After "fgrep -rn 'u16' * | fgrep '~0'", it seems better to define a
meaningful macro for it (e.g. "#define SKB_HEADER_WAS_UNSET 0xffff").


Thanks.
--
Chen Gang

Asianux Corporation
--
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/