[PATCH 1/3][MTD] P4080/eLBC: Make Freescale elbc interrupt common to elbc devices

Anton Vorontsov cbouatmailru at gmail.com
Mon Sep 6 04:21:42 EDT 2010


On Mon, Sep 06, 2010 at 11:38:09AM +0800, Zang Roy-R61911 wrote:
[...]
> > >  	switch (br & BR_MSEL) {
> > >  	case BR_MS_UPMA:
> > > -		upm->mxmr = &fsl_lbc_regs->mamr;
> > > +		upm->mxmr = &fsl_lbc_ctrl_dev->regs->mamr;
> > 
> > Ditto, a very repetitive stuff, desires a variable for regs?
> But the fact is that the variable represents different reg
> address according to the condition. It will be ugly to use
> the reg address directoly.

I meant a dedicated var for 'fsl_lbc_ctrl_dev->regs'.
I.e.

regs = fsl_lbc_ctrl_dev->regs;
...
mxmr = &regs->mamr;
...
mxmr = &regs->mbmr;
..
mxmr = &regs->mcmr;

Instead of

mxmr = &fsl_lbc_ctrl_dev->regs->mamr;
...
mxmr = &fsl_lbc_ctrl_dev->regs->mbmr;
..
mxmr = &fsl_lbc_ctrl_dev->regs->mcmr;

[...]
> > > +static int __devinit fsl_lbc_ctrl_probe(struct of_device *ofdev,
> > > +					 const struct of_device_id *match)
> > > +{
> > > +	int ret = 0;
> > 
> > no need for the initial value here.
> Any harm?

Probably not as gcc will likely optimize it away,
but it's not needed, so why keep it there?

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2



More information about the linux-mtd mailing list