[Cbe-oss-dev] arch/powerpc/platforms/cell/pmu.c fix

Arnd Bergmann arnd at arndb.de
Tue Mar 18 12:16:37 EST 2008


On Monday 17 March 2008, Geoff Levand wrote:
> On 03/17/2008 09:51 AM, Denis Joseph Barrow wrote:
> > Hi,
> > Just putting a bit of lipstick on no code functionality changes.
> > 
> > Subject: Cell Performance Measurment Unit
> > WRITE_WO_MMIO(reg, x) macro etc. is using a cpu in the macro
> > never defined in the parameter list, this is bad coding style.
> > I used do it myself & other programmers got upset about it so I stopped.

Right, thanks for addressing this, I think nobody ever noticed it
in earlier reviews.

> > Signed-off-by: Denis Joseph Barrow <denis.barrow at sonycom.com>
> > ---
> >  arch/powerpc/platforms/cell/pmu.c |   50 +++++++++++++++++++-------------------
> >  1 file changed, 25 insertions(+), 25 deletions(-)
> > 
> > --- a/arch/powerpc/platforms/cell/pmu.c
> > +++ b/arch/powerpc/platforms/cell/pmu.c
> > @@ -40,7 +40,7 @@
> >   * pmd_regs.
> >   */
> >  
> > -#define WRITE_WO_MMIO(reg, x)                                        \
> > +#define WRITE_WO_MMIO(cpu, reg, x)                           \
> 
> These should be static inline functions as to get proper
> scope and type checking.

Unfortunately, this doesn't work, because the macros depend on using the
reg argument as the name of a member in two different data structures.
A static inline function would certainly be preferrable, but I can't
see how we could do that here. If nobody comes up with a better idea,
I'd just take DJ's patch as is.

	Arnd <><



More information about the cbe-oss-dev mailing list