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

From: Andy Shevchenko
Date: Fri May 31 2013 - 17:05:19 EST


On Thu, May 30, 2013 at 9:03 AM, Chen Gang <gang.chen@xxxxxxxxxxx> wrote:
>
> Both 'transport_header' and 'mac_header' are u16, which are never equal
> to '~0U'.
>
> So need use '0xffff' instead of '~0U'.

Why not "(u16)~0" ?
Or even better "!= USHORT_MAX"?

Or mac_header + 1 == 0, though it less clear.

--
With Best Regards,
Andy Shevchenko
--
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/