[U-Boot] [PATCH v5] bitops: introduce BIT() definition

ivan.khoronzhuk ivan.khoronzhuk at linaro.org
Tue Sep 8 20:01:05 CEST 2015


Hi, Andreas

On 07.09.15 14:43, Andreas Bießmann wrote:
> From: Heiko Schocher <hs at denx.de>
>
> introduce BIT() definition, used in at91_udc gadget
> driver.
>
> Signed-off-by: Heiko Schocher <hs at denx.de>
> [remove all other occurrences of BIT(x) definition]
> Signed-off-by: Andreas Bießmann <andreas.devel at googlemail.com>
> ---
> Full buildman is running
>

....

>
> +#define BIT(nr)		(1UL << (nr))

Why UL? Why not simply 1 << (nr)?
What if I need set ULL bit on 32-bit system?
Thanks for explanation.

> +
>   /*
>    * ffs: find first bit set. This is defined the same way as
>    * the libc and compiler builtin ffs routines, therefore
>


More information about the U-Boot mailing list