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

Wolfgang Denk wd at denx.de
Wed Sep 9 20:25:40 CEST 2015


Dear Andreas,

In message <1441626234-16364-1-git-send-email-andreas.devel at googlemail.com> you wrote:
...
> --- a/include/linux/bitops.h
> +++ b/include/linux/bitops.h
> @@ -3,6 +3,8 @@
>  
>  #include <asm/types.h>
>  
> +#define BIT(nr)		(1UL << (nr))

What happens when someone decides to use this on a 64 bit register?

Also, this definition is inherently wrong for Power Architecture (TM)
systems, where bit 0 is the most significant bit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Today is the yesterday you worried about tomorrow.


More information about the U-Boot mailing list