From: Wolfgang Denk Date: Mon, 28 Mar 2011 07:57:07 +0200 Subject: [U-Boot] [PATCH V4 1/6] io: add and* and or* operation api to set and clear bit In-Reply-To: <1301291335-13734-2-git-send-email-leiwen@marvell.com> References: <1300344306-26608-1-git-send-email-leiwen@marvell.com> <1301291335-13734-2-git-send-email-leiwen@marvell.com> Message-ID: <20110328055707.5C032D1BDBF@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Lei Wen, In message <1301291335-13734-2-git-send-email-leiwen@marvell.com> you wrote: > Those api take use of read*/write* to align the current dmb usage. > Also this could short the code length in one line. > > Signed-off-by: Lei Wen > --- > arch/arm/include/asm/io.h | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h > index 1fbc531..71e85e8 100644 > --- a/arch/arm/include/asm/io.h > +++ b/arch/arm/include/asm/io.h > @@ -141,6 +141,14 @@ extern inline void __raw_readsl(unsigned int addr, void *data, int longlen) > #define readw(c) ({ u16 __v = __arch_getw(c); __iormb(); __v; }) > #define readl(c) ({ u32 __v = __arch_getl(c); __iormb(); __v; }) > > +#define orb(v,c) writeb(readb(c) | v, c) > +#define orw(v,c) writew(readw(c) | v, c) > +#define orl(v,c) writel(readl(c) | v, c) > + > +#define andb(v,c) writeb(readb(c) & v, c) > +#define andw(v,c) writew(readw(c) & v, c) > +#define andl(v,c) writel(readl(c) & v, c) checkpatch gixes errors for all of these lines: ERROR: space required after that ',' (ctx:VxV) #72: FILE: arch/arm/include/asm/io.h:144: +#define orb(v,c) writeb(readb(c) | v, c) ^ etc. Please fix. 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 "Once they go up, who cares where they come down? That's not my department." - Werner von Braun