Re: [PATCH V2 04/25] MIPS: ath79: fix register address in ath79_ddr_wb_flush()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Fri, Jul 20, 2018 at 06:44:17PM +0300, Sergei Shtylyov wrote:
> > diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
> > index fad32543a968..cd6055f9e7a0 100644
> > --- a/arch/mips/ath79/common.c
> > +++ b/arch/mips/ath79/common.c
> > @@ -58,7 +58,7 @@ EXPORT_SYMBOL_GPL(ath79_ddr_ctrl_init);
> >  
> >  void ath79_ddr_wb_flush(u32 reg)
> >  {
> > -	void __iomem *flush_reg = ath79_ddr_wb_flush_base + reg;
> > +	void __iomem *flush_reg = ath79_ddr_wb_flush_base + (reg * 4);
> 
>    Parens not needed, the operator priorities are natural.

Whilst true, I don't think they're detrimental here - they help the code
to be readable without the mental step of thinking "oh, yes,
multiplication takes precedence over addition" or taking a walk down
memory lane to school math classes where a teacher desperately tried to
hammer BODMAS into the heads of mostly uninterested children.

All that to say, I think the brackets are fine here.

Thanks,
    Paul




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux