[U-Boot] [PATCH V5.1 1/6] io: add and* and or* operation api to set and clear bit

Mike Frysinger vapier at gentoo.org
Tue Mar 29 07:44:07 CEST 2011


On Tue, Mar 29, 2011 at 1:40 AM, Prafulla Wadaskar wrote:
> From: Lei Wen [mailto:leiwen at marvell.com]
>> +#define orb(v, c)       writeb(readb(c) | (v), c)
>
> If I am not wrong, this should be like
> #define orb(v, c)       writeb((readb(c) | v), c)

no, Lei's version is correct.  yours mishandles v, and adds useless
paren to the first arg to writeb.  writeb itself should be wrapping
its first arg in paren if need be.
-mike


More information about the U-Boot mailing list