[i2c] "driver forgot to specify physical device"

Till Harbaum / Lists lists at harbaum.org
Wed Apr 18 19:31:32 CEST 2007


Hi Jean,

Am Mittwoch 18 April 2007 schrieb Jean Delvare:
> First of all: please provide your driver as a patch against a recent
> kernel tree. Something that I can easily apply and test-compile.
Ok, i'll give it a try.

> >  * This driver is based on the 2.6.3 version of
> > drivers/usb/usb-skeleton.c * but has been rewritten to be easy to read
> > and use, as no locks are now * needed anymore.
>
> If the skeleton driver is out-of-date, can you please submit an update
> for it? It would be more valuable for the community than this comment
> (which quite frankly doesn't add any value to your driver.)
Oops, that comment which in fact isn't really a very useful contribution 
wasn't by me but by the original usb driver i based my code upon.
Since there's not much left of the usb skeleton driver in this project
the comment just doesn't apply anymore. I'll just remove it.

Thanks for the detailed analysis of my code, i really appreciate your review. 
But i already have some remarks

> > #define CMD_ECHO       0
> Not used anywhere.
I like to have all the possible commands in there, even if i don't use them as 
they give a reader an idea of the complete protocol.

> Did you try inlining these two functions? I suspect your driver would
> be faster _and_ smaller.
From the CodingStyle doc:
A reasonable rule of thumb is to not put inline at functions that have more
than 3 lines of code in them.

In general the CodingStyle suggests to use inline only like a replacement for
preprocessor macros and basically suggests not to use them at all since it
claims that gcc is able to do the inlining without any explicit help and once 
this function is used a second or third time gcc would automatically stop 
inlining it.

Regards,
  Till




More information about the i2c mailing list