[U-Boot-Users] [PATCH v2 3/7] add an i2c driver for mx31

Guennadi Liakhovetski lg at denx.de
Tue Apr 15 00:28:21 CEST 2008


On Mon, 14 Apr 2008, Wolfgang Denk wrote:

> In message <20080414064659.GB17663 at game.jcrosoft.org> you wrote:
> >
> > > +#if defined(CONFIG_HARD_I2C) && defined (CONFIG_I2C_MXC)
> > Please stop to define this here, move it the Makefile
> 
> Hm... While I agree with the simple standard case of a single
> "#ifdef", I'm not so 100% sure it is a good thing to add such complex
> expressions to the Makefile.
> 
> Aren't we just moving the #ifdef hell from one place to another?

Wouldn't it be logical to assume, that if CONFIG_I2C_MXC is defined, 
CONFIG_HARD_I2C is meant too? So, we could just put in i2c.h

#ifdef CONFIG_I2C_MXC
#define CONFIG_HARD_I2C
#endif

And then use the simple

OBJC-$(CONFIG_I2C_MXC) += ...

Incremental patch?

in the Makefile? I personally do prefer when unneeded .c files do not get 
compiled at all, rather than compiled to "0"-byte big objects. Makes the 
build process and the resulting tree look cleaner, and the image a bit 
smaller.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de




More information about the U-Boot mailing list