[U-Boot] [PATCH] 7/12 Multiadapter/multibus I2C, drivers part 4

ksi at koi8.net ksi at koi8.net
Tue Feb 17 21:02:49 CET 2009


On Mon, 16 Feb 2009, Wolfgang Denk wrote:

> Dear ksi at koi8.net,
> 
> In message <Pine.LNX.4.64ksi.0902121423570.21067 at home-gw.koi8.net> you wrote:
> >
> > +#define I2C_SOFT_SEND_START(n) \
> > +static void send_start##n(void) \
> > +{ \
> > +	I2C_SOFT_DECLARATIONS##n \
> > +	I2C_DELAY##n; \
> > +	I2C_SDA##n(1); \
> > +	I2C_ACTIVE##n; \
> > +	I2C_DELAY##n; \
> > +	I2C_SCL##n(1); \
> > +	I2C_DELAY##n; \
> > +	I2C_SDA##n(0); \
> > +	I2C_DELAY##n; \
> >  }
> 
> Sorry, but that's becoming an unreadable mess. I don't think I'm going
> to ACK such code.

There is nothing unreadable there. The only alternative I see is to put
several instances of the same functions with those "##n" expanded by hand
instead of letting CPP do it. No problems, I can do that if you want me to.
But it will not make code any more readable or smaller and the final result
will be exactly the same, byte-to-byte.

I can't see any problems with that code--it is in the same single file,
not used anywhere else, cpp magic used is trivial ("##n" is replaced with
literal "n" parameter in instances,) the functions look and feel almost like
original ones--but sure, I can do CPP work myself and put several instances
manually.

Please let me know if you really want me to do this.

---
******************************************************************
*  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