[U-Boot] [PATCH] Davinci I2C code cleanup

Wolfgang Denk wd at denx.de
Sun Feb 22 22:27:38 CET 2009


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090222124436.GA9867 at game.jcrosoft.org> you wrote:
> On 13:52 Thu 19 Feb     , ksi at koi8.net wrote:
> > Removed CHECK_NACK macro from Davinci I2C driver for code cleanup.
> > 
> > Signed-off-by: Sergey Kubushyn <ksi at koi8.net>
> > ---
> >  cpu/arm926ejs/davinci/i2c.c |   62 +++++++++++++++++++++++++---------
> >  1 files changed, 45 insertions(+), 17 deletions(-)
> NACK
> 
> please explain why

Please see previous discussion about multibus I2C support.

> IMHO duplicate code is really wrong

I agree. The macro should indeed NOT be deleted, but it needs fixing.
It is magically accessing the local variable "tmp" which [Quoting the
CodingStyle] "...might look like a good thing, but it's confusing  as
hell  when  one  reads  the  code  and  it's  prone  to breakage from
seemingly innocent changes."

I suggest that "tmp" gets passed as argument to the macro.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There you go man, Keep as cool as you can. It riles them  to  believe
that you perceive the web they weave. Keep on being free!


More information about the U-Boot mailing list