Skip to contentSkip to conversation

Many headers included multiple times

PATCH In review Steve Kemp 2 participants 2 messages Nov 1, 2008 – Nov 7, 2008

Subsystems (10)
lore
Share & tools
lore

Steve Kemp

author
#0 lore raw

PATCH 1/1 Many headers included multiple times

There are many source files which include the same header multiple
times. Minimal initial patch included here, will submit the rest shortly if there is interest.

Quick tool to detect these: http://www.steve.org.uk/Software/kernel/

drivers/mtd/onenand/omap2.c +0 -1
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/mtd/onenand/omap2.c linux-2.6.28-rc2/drivers/mtd/onenand/omap2.c
@@ -38,7 +27,6 @@
 #include <asm/arch/gpmc.h>
 #include <asm/arch/onenand.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/gpmc.h>
 #include <asm/arch/pm.h>
 
 #include <linux/dma-mapping.h>
drivers/net/irda/ks959-sir.c +0 -1
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/net/irda/ks959-sir.c linux-2.6.28-rc2/drivers/net/irda/ks959-sir.c
@@ -118,7 +107,6 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 #include <linux/kref.h>
 #include <linux/usb.h>
 #include <linux/device.h>
drivers/parisc/ccio-dma.c +0 -1
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/parisc/ccio-dma.c linux-2.6.28-rc2/drivers/parisc/ccio-dma.c
@@ -70,7 +70,6 @@
 #undef CCIO_COLLECT_STATS
 #endif
 
-#include <linux/proc_fs.h>
 #include <asm/runway.h>		/* for proc_runway_root */
 
 #ifdef DEBUG_CCIO_INIT
drivers/pnp/interface.c +0 -1
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/pnp/interface.c linux-2.6.28-rc2/drivers/pnp/interface.c
@@ -12,7 +12,6 @@
 #include <linux/errno.h>
 #include <linux/list.h>
 #include <linux/types.h>
-#include <linux/pnp.h>
 #include <linux/stat.h>
 #include <linux/ctype.h>
 #include <linux/slab.h>
drivers/scsi/gvp11.c +0 -2
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/scsi/gvp11.c linux-2.6.28-rc2/drivers/scsi/gvp11.c
@@ -360,8 +360,6 @@
 
 #define HOSTS_C
 
-#include "gvp11.h"
-
 static struct scsi_host_template driver_template = {
 	.proc_name		= "GVP11",
 	.name			= "GVP Series II SCSI",
drivers/scsi/ibmvscsi/ibmvscsi.c +0 -1
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/scsi/ibmvscsi/ibmvscsi.c linux-2.6.28-rc2/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -72,7 +72,6 @@
 #include <linux/delay.h>
 #include <asm/firmware.h>
 #include <asm/vio.h>
-#include <asm/firmware.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_host.h>
drivers/scsi/mvme147.c +0 -2
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/scsi/mvme147.c linux-2.6.28-rc2/drivers/scsi/mvme147.c
@@ -130,8 +130,6 @@
 
 #define HOSTS_C
 
-#include "mvme147.h"
-
 static struct scsi_host_template driver_template = {
 	.proc_name		= "MVME147",
 	.name			= "MVME147 built-in SCSI",
drivers/video/via/global.h +1 -5
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/video/via/global.h linux-2.6.28-rc2/drivers/video/via/global.h
@@ -34,26 +34,22 @@
 #include <linux/timer.h>
 
 #include "debug.h"
-
 #include "iface.h"
 #include "viafbdev.h"
 #include "chip.h"
-#include "debug.h"
 #include "accel.h"
 #include "share.h"
 #include "dvi.h"
 #include "viamode.h"
 #include "via_i2c.h"
 #include "hw.h"
-
 #include "lcd.h"
 #include "ioctl.h"
-#include "viamode.h"
 #include "via_utility.h"
 #include "vt1636.h"
 #include "tblDPASetting.h"
 #include "tbl1636.h"
-#include "viafbdev.h"
+
 
 /* External struct*/
 
drivers/xen/balloon.c +0 -1
diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/xen/balloon.c linux-2.6.28-rc2/drivers/xen/balloon.c
@@ -41,7 +41,6 @@
 #include <linux/pagemap.h>
 #include <linux/highmem.h>
 #include <linux/mutex.h>
-#include <linux/highmem.h>
 #include <linux/list.h>
 #include <linux/sysdev.h>
 

Steve

Signature · 2 lines
# The Debian Security Audit Project.
http://www.debian.org/security/audit
#1 lore raw
Quoted 5 lines · On Sat, 1 Nov 2008 11:15:38 +0000 Steve Kemp…

There are many source files which include the same header multiple times. Minimal initial patch included here, will submit the rest shortly if there is interest.

Quick tool to detect these: http://www.steve.org.uk/Software/kernel/

I flee in terror from patches like this because of the risk that someone else will delete the _other_ #include, and this patch still applies OK, so we end up removing both #includes and things break. This has happened before.

Thought: if the patch were to delete one #include and to then move the other one to a different position in the #include order then this couldn't happen.