[PATCH] Many headers included multiple times - Kernel

This is a discussion on [PATCH] Many headers included multiple times - Kernel ; 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/ Signed-off-by: Steve Kemp diff --ignore-space-change --unified --recursive linux-2.6.28-rc2.orig/drivers/mtd/onenand/omap2.c ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] Many headers included multiple times

  1. [PATCH] 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/

    Signed-off-by: Steve Kemp

    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
    --- linux-2.6.28-rc2.orig/drivers/mtd/onenand/omap2.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/mtd/onenand/omap2.c 2008-11-01 11:04:56.000000000 +0000
    @@ -38,7 +27,6 @@
    #include
    #include
    #include
    -#include
    #include

    #include
    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
    --- linux-2.6.28-rc2.orig/drivers/net/irda/ks959-sir.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/net/irda/ks959-sir.c 2008-11-01 11:10:44.000000000 +0000
    @@ -118,7 +107,6 @@
    #include
    #include
    #include
    -#include
    #include
    #include
    #include
    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
    --- linux-2.6.28-rc2.orig/drivers/parisc/ccio-dma.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/parisc/ccio-dma.c 2008-11-01 11:10:10.000000000 +0000
    @@ -70,7 +70,6 @@
    #undef CCIO_COLLECT_STATS
    #endif

    -#include
    #include /* for proc_runway_root */

    #ifdef DEBUG_CCIO_INIT
    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
    --- linux-2.6.28-rc2.orig/drivers/pnp/interface.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/pnp/interface.c 2008-11-01 11:08:01.000000000 +0000
    @@ -12,7 +12,6 @@
    #include
    #include
    #include
    -#include
    #include
    #include
    #include
    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
    --- linux-2.6.28-rc2.orig/drivers/scsi/gvp11.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/scsi/gvp11.c 2008-11-01 11:07:12.000000000 +0000
    @@ -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",
    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
    --- linux-2.6.28-rc2.orig/drivers/scsi/ibmvscsi/ibmvscsi.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/scsi/ibmvscsi/ibmvscsi.c 2008-11-01 11:08:30.000000000 +0000
    @@ -72,7 +72,6 @@
    #include
    #include
    #include
    -#include
    #include
    #include
    #include
    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
    --- linux-2.6.28-rc2.orig/drivers/scsi/mvme147.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/scsi/mvme147.c 2008-11-01 11:06:56.000000000 +0000
    @@ -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",
    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
    --- linux-2.6.28-rc2.orig/drivers/video/via/global.h 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/video/via/global.h 2008-11-01 11:05:53.000000000 +0000
    @@ -34,26 +34,22 @@
    #include

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

    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
    --- linux-2.6.28-rc2.orig/drivers/xen/balloon.c 2008-10-26 19:13:29.000000000 +0000
    +++ linux-2.6.28-rc2/drivers/xen/balloon.c 2008-11-01 11:04:21.000000000 +0000
    @@ -41,7 +41,6 @@
    #include
    #include
    #include
    -#include
    #include
    #include

    Steve
    --
    # The Debian Security Audit Project.
    http://www.debian.org/security/audit

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH] Many headers included multiple times

    On Sat, 1 Nov 2008 11:15:38 +0000
    Steve Kemp wrote:

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

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread