Greg KH wrote: >On Sat, Feb 19, 2005 at 08:58:48AM -0800, Mickey Stein wrote: > > >>From: Mickey Stein >> Versions: linux-2.6.11-rc4-bk7, gcc4 (GCC) 4.0.0 20050217 (latest fc >>rawhide from 19Feb DL) >> >> gcc4 cvs seems to dislike "include/linux/i2c.h file": >> >> Error msg: include/linux/i2c.h:{55,194} error: array type has >>incomplete element type >> >> A. Daplas has recently done a workaround for this on another header >>file. A thread discussing this >> can be found by following the link below: >> >> http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html >> >> The patch changes the array declaration from "struct x y[]" format to >>"struct x *y". >> I realize its only a workaround, but the gcc guys seem to be aware of >>this. >> ** Note: I'm a noob at this, so feel free to make chopped liver out of >>this if its incorrect. >> patch below is also attached since I'm not sure formatting survives >>the cut&paste. >> >> > >The patch looks sane, but before I apply it, care to also fix up all of >the function pointers that are affected by this patch? Also the >i2c_transfer() function itself should be changed (not just the header >file.) > >thanks, > >greg k-h > > > Greg, I took a look for other references similar to those in my first take at this and found a couple more files. Attached is another patch that hopefully addresses the all the similar cases. I tried it on today's (-bk8) kernel, with all i2c switches enabled. From: Mickey Stein Versions: linux-2.6.11-rc4-bk8, gcc4 (GCC) 4.0.0 20050217 (latest fc rawhide from 19Feb DL) gcc4 cvs seems to dislike "include/linux/i2c.h, i2c-core.c files". I also tweaked the Documentation/i2c/writing-clients file. Error msg: include/linux/i2c.h:{55,194} error: array type has incomplete element type A. Daplas has recently done a workaround for this on another header file. A thread discussing this can be found by following the link below: http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html The patch changes the i2c-transfer code in i2c.h from "struct x y[]" format to "struct x *y". It also changes the associated i2c-transfer declarations in i2c-core.c. It tweaks the Documentation/i2c/writing-clients file to reconcile i2c-transfer docs. I realize its only a workaround, but the gcc guys seem to be aware of this. Thanks very much, Mickey Stein Signed-off-by: Mickey Stein