[U-Boot] PATCH 2/8 Multi-adapter multi-bus I2C
ksi at koi8.net
ksi at koi8.net
Tue Feb 10 01:07:39 CET 2009
On Tue, 10 Feb 2009, Wolfgang Denk wrote:
> Dear ksi at koi8.net,
>
> In message <Pine.LNX.4.64ksi.0902091353360.32084 at home-gw.koi8.net> you wrote:
> >
> > > Why do you here substitute a "dev->" with "&i2c_dev[adap_no]"?
> > > Why not dev = &i2c_dev[adap_no] and you can let the dev-> unchanged.
> >
> > This eliminates one variable, dev. Another reason is uniformity through the
> > entire driver source.
>
> But it makes the code harder to read.
>
> Maybe we should rather change the other places in the driver to do the
> same?
>
> Note that it is NOT a goal for optimizations to save variables -
> variables are extremely cheap, as they are just ameans to make the
> code readable. The compiler will know much better than we how to
> allocate memory or registers to hold such data.
>
> > Anyway, keeping that dev won't make any difference other than making the
> > patch a tad shorter...
>
> ... and the code better readable.
OK, I can keep that dev, no problems. I'm not sure it makes code any more
readable though... And it is just a couple of places.
---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************
More information about the U-Boot
mailing list