Skip to contentSkip to conversation

drivers/i2c/busses/i2c-piix4.c: kill duplicate

TRIVIAL 2.6 Jean Delvare 4 participants 8 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi Arthur,

Quoted 11 lines

From scripts/checkincludes.pl:

./drivers/i2c/busses/i2c-piix4.c: linux/config.h is included more than once.

Against 2.6.5. Thanks.

drivers/i2c/busses/i2c-piix4.c line 36

Quoted 7 lines
drivers/i2c/busses/i2c-piix4.c +0 -1
@@ -31,7 +31,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>

Actually there are more problems than just this one:

1* scx200_acb.c, scx200_i2c.c and i2c-keywest.c also include version.h
twice.

2* Most i2c bus drivers do not need to include it at all. Greg, I guess
this is a leftover from the old debugging scheme?

3* Same goes for most (all?) i2c chip drivers, and core i2c drivers too:
they include config.h but don't seem to need it.

If would probably be better to solve all these problems at once. I think we should get rid of all useless includes. Greg, can you confirm?

Rusty, I think you can leave this one to Greg and I, we'll handle it.

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#1 lore raw
Quoted 23 lines · Jean Delvare

Hi Arthur,

Quoted 11 lines

From scripts/checkincludes.pl:

./drivers/i2c/busses/i2c-piix4.c: linux/config.h is included more than once.

Against 2.6.5. Thanks.

drivers/i2c/busses/i2c-piix4.c line 36

Quoted 7 lines
drivers/i2c/busses/i2c-piix4.c +0 -1
@@ -31,7 +31,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>

Actually there are more problems than just this one:

Quoted 2 lines

1* scx200_acb.c, scx200_i2c.c and i2c-keywest.c also include version.h
twice.

I sent separate patches for these three to <[email protected]> (scx200_{acb,i2c}.c) and <[email protected]> (i2c-keywest.c) (Cc: <[email protected]>), but ...

Quoted 10 lines

2* Most i2c bus drivers do not need to include it at all. Greg, I guess
this is a leftover from the old debugging scheme?

3* Same goes for most (all?) i2c chip drivers, and core i2c drivers too:
they include config.h but don't seem to need it.

If would probably be better to solve all these problems at once. I think we should get rid of all useless includes. Greg, can you confirm?

Rusty, I think you can leave this one to Greg and I, we'll handle it.

.. it's good to know you'll be looking more closely at these :)

Quoted 6 lines

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#2 lore raw
In reply to Jean Delvare
Quoted 23 lines · Jean Delvare

Hi Arthur,

Quoted 11 lines

From scripts/checkincludes.pl:

./drivers/i2c/busses/i2c-piix4.c: linux/config.h is included more than once.

Against 2.6.5. Thanks.

drivers/i2c/busses/i2c-piix4.c line 36

Quoted 7 lines
drivers/i2c/busses/i2c-piix4.c +0 -1
@@ -31,7 +31,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>

Actually there are more problems than just this one:

Quoted 5 lines

1* scx200_acb.c, scx200_i2c.c and i2c-keywest.c also include version.h
twice.

2* Most i2c bus drivers do not need to include it at all. Greg, I guess
this is a leftover from the old debugging scheme?

Probably.

Quoted 5 lines

3* Same goes for most (all?) i2c chip drivers, and core i2c drivers too:
they include config.h but don't seem to need it.

If would probably be better to solve all these problems at once. I think we should get rid of all useless includes. Greg, can you confirm?

Yes, but be careful of includes that are needed by other arches to build properly. Sometimes it's hard to find those.

thanks,

greg k-h

#3 lore raw
In reply to Jean Delvare
Quoted 3 lines · Jean Delvare

Sorry for the confusion, I was only refering to config.h, not just "all" headers. Is it OK if I provide a patch that removes unneeded config.h includes from all chip, bus and i2c core drivers?

Maybe I'm missing something but since when <linux/config.h> is not needed?

Are you sure this change will not break build on some archs/configs?

So far my experience has been (at least in 2.4) that usually header files don't include all required headers themselves, relying on *.c to include everything properly (maybe it's just on PPC though).

Eugene.

#4 lore raw
In reply to Jean Delvare
Quoted 8 lines
Quoted 2 lines

2* Most i2c bus drivers do not need to include it at all. Greg, I guess this is a leftover from the old debugging scheme?

Probably.

Quoted 3 lines

3* Same goes for most (all?) i2c chip drivers, and core i2c drivers
too: they include config.h but don't seem to need it.

Quoted 6 lines
Quoted 3 lines

If would probably be better to solve all these problems at once. I think we should get rid of all useless includes. Greg, can you confirm?

Yes, but be careful of includes that are needed by other arches to build properly. Sometimes it's hard to find those.

Sorry for the confusion, I was only refering to config.h, not just "all" headers. Is it OK if I provide a patch that removes unneeded config.h includes from all chip, bus and i2c core drivers?

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#5 lore raw
In reply to Jean Delvare
Quoted 4 lines

Maybe I'm missing something but since when <linux/config.h> is not needed?

Are you sure this change will not break build on some archs/configs?

I am assuming that #include <linux/config.h> is needed if and only if the code makes use of any CONFIG_* value. Am I wrong?

Quoted 3 lines

So far my experience has been (at least in 2.4) that usually header files don't include all required headers themselves, relying on *.c to include everything properly (maybe it's just on PPC though).

Such headers are broken and need fixing IMHO.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#6 lore raw
In reply to Jean Delvare
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

So far my experience has been (at least in 2.4) that usually header files don't include all required headers themselves, relying on *.c to include everything properly (maybe it's just on PPC though).

Such headers are broken and need fixing IMHO.

Maybe, are you going to fix them all _before_ changing i2c layer :) ?

I am certainly not.

Quoted 2 lines

I agree it's a mess, but removing config.h you might break code which is fine right now. Is such clean up worth it?

I think it is, as long as we are working on the HEAD of Linux. However, what I think is obviously not what matters, what Greg thinks is.

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#7 lore raw
In reply to Jean Delvare
Quoted 7 lines · Jean Delvare
Quoted 4 lines

Maybe I'm missing something but since when <linux/config.h> is not needed?

Are you sure this change will not break build on some archs/configs?

I am assuming that #include <linux/config.h> is needed if and only if the code makes use of any CONFIG_* value. Am I wrong?

Yes, but as I told a lot of headers don't include config.h but depend on CONFIG_XXX defines, at least in arch-specific code.

Quoted 5 lines
Quoted 3 lines

So far my experience has been (at least in 2.4) that usually header files don't include all required headers themselves, relying on *.c to include everything properly (maybe it's just on PPC though).

Such headers are broken and need fixing IMHO.

Maybe, are you going to fix them all _before_ changing i2c layer :) ?

I agree it's a mess, but removing config.h you might break code which is fine right now. Is such clean up worth it?

Eugene.