[PATCH 03/13] mpc52xx: add SCLPC register bit definitions

Wolfgang Denk wd at denx.de
Tue Jan 12 07:50:25 EST 2010


Dear Grant Likely,

In message <fa686aa41001111121u5c943fc7p789c0ec0b41af883 at mail.gmail.com> you wrote:
>
> >  /* mpc52xx_lpbfifo.c */
> >  #define MPC52XX_LPBFIFO_FLAG_READ              (0)
> > -#define MPC52XX_LPBFIFO_FLAG_WRITE             (1<<0)
> > -#define MPC52XX_LPBFIFO_FLAG_NO_INCREMENT      (1<<1)
> > -#define MPC52XX_LPBFIFO_FLAG_NO_DMA            (1<<2)
> > -#define MPC52XX_LPBFIFO_FLAG_POLL_DMA          (1<<3)
> > +#define MPC52XX_LPBFIFO_FLAG_WRITE             BIT(0)
> > +#define MPC52XX_LPBFIFO_FLAG_NO_INCREMENT      BIT(1)
> > +#define MPC52XX_LPBFIFO_FLAG_NO_DMA            BIT(2)
> > +#define MPC52XX_LPBFIFO_FLAG_POLL_DMA          BIT(3)
> 
> I prefer the (1<<n) style myself.

Indeed, especially as one can argue that "(1<<0)" should be "BIT(31)"
on Power Architecture systems, where bit 0 is the MSB by definition.

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
Do not simplify the design of a program if a way can be found to make
it complex and wonderful.


More information about the Linuxppc-dev mailing list