[U-Boot] [PATCH 2/3] Add generic bit operations

Wolfgang Denk wd at denx.de
Thu Jun 4 13:47:17 CEST 2009


Dear Daniel Mack,

In message <1244111241-32735-3-git-send-email-daniel at caiaq.de> you wrote:
> This adds generic bit operations for all platforms and enables includes
> the implementations from asm-arm.

I should have read the patch to end...

> +static inline void set_bit(int nr, volatile unsigned long *addr)
> +{
> +	unsigned long mask = BIT_MASK(nr);
> +	unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
> +
> +	*p  |= mask;
> +}
> +
> +static inline void clear_bit(int nr, volatile unsigned long *addr)
> +{
> +	unsigned long mask = BIT_MASK(nr);
> +	unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
> +
> +	*p &= ~mask;
> +}

Such code has no chance of being accepted anyway.

It tries to be generic and does not care if you use it on memory or
device addresses - but for device addresses, the use of proper I/O
accessor functions is mandatory.


Full NAK.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
I really hate this damned machine     It never does quite what I want
I wish that they would sell it.              But only what I tell it.


More information about the U-Boot mailing list