[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140708114227.GB27659@pd.tnic>
Date: Tue, 8 Jul 2014 13:42:28 +0200
From: Borislav Petkov <bp@...en8.de>
To: Pavel Machek <pavel@...x.de>
Cc: tthayer@...era.com, robherring2@...il.com, pawel.moll@....com,
mark.rutland@....com, ijc+devicetree@...lion.org.uk,
galak@...eaurora.org, rob@...dley.net, linux@....linux.org.uk,
dinguyen@...era.com, dougthompson@...ssion.com,
grant.likely@...aro.org, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
tthayer.linux@...il.com, linux-arm-kernel@...ts.infradead.org,
linux-edac@...r.kernel.org
Subject: Re: [PATCHv7 3/3] edac: altera: Add EDAC support for Altera SoC
SDRAM Controller.
On Tue, Jul 08, 2014 at 01:31:09PM +0200, Pavel Machek wrote:
> > + read_reg = readl(mc_vbase + DRAMADDRW);
> > +
> > + width = readl(mc_vbase + DRAMIFWIDTH);
> > +
> > + col = (read_reg & DRAMADDRW_COLBIT_MASK) >>
> > + DRAMADDRW_COLBIT_LSB;
> > + row = (read_reg & DRAMADDRW_ROWBIT_MASK) >>
> > + DRAMADDRW_ROWBIT_LSB;
> > + bank = (read_reg & DRAMADDRW_BANKBIT_MASK) >>
> > + DRAMADDRW_BANKBIT_LSB;
> > + cs = (read_reg & DRAMADDRW_CSBIT_MASK) >>
> > + DRAMADDRW_CSBIT_LSB;
>
> As I said, all the defines only make this harder to read. The code is
> pretty obvious if you put numbers in here...
Since when it is a good coding practice to put naked numbers instead of
descriptive macro names??!
Now, I can understand that the macro names could be made more
descriptive so that you can understand what they mean, but naked
numbers?! You must be joking although 1st of April is long gone.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists