[PATCH] remove unnecessary #includes from <linux/fs.h>

From: Jörn Engel (joern_at_wohnheim.fh-wedel.de)
Date: 10/02/03

  • Next message: Randy.Dunlap: "Re: [PATCH] export [__]set_special_pids()"
    Date:	Thu, 2 Oct 2003 18:16:39 +0200
    To: Russell King <rmk@arm.linux.org.uk>, Kernel Mailing List <linux-kernel@vger.kernel.org>, Sam Ravnborg <sam@ravnborg.org>
    
    

    On Sun, 28 September 2003 22:00:01 +0200, Jörn Engel wrote:
    > On Sun, 28 September 2003 20:42:24 +0100, Russell King wrote:
    > >
    > > and that will prevent the #include maze of 2.4, which resulted in
    > > everything being rebuilt just because one header file was touched.
    >
    > Ok, how about this:
    >
    > for each header file {
    > make header.o
    > 1) if it doesn't build {
    > print out a warning
    > continue
    > }
    > for each #include line {
    > remove the #include line
    > make header.o
    > 2) if it build {
    > print out a warning
    > }
    > 3) if there are less than x gcc warnings {
    > print out a warning
    > }
    > }
    > }

    You didn't comment on my suggestion, so I've done it manually once for
    linux/fs.h and was shocked. It still passes my compile-standalone
    test after removing 11! #include lines.

    Another one was a false hit, because I compiled UP only, and some of
    the remaining may be as well, but it looks like we recompile way too
    much after changes to a random header.

    Russell, can you comment this time, or should I shove the patch to
    Linus and wait if anyone starts screaming?

    Jörn

    -- 
    Sometimes, asking the right question is already the answer.
    -- Unknown
    --- linux-2.6.0-test5/include/linux/fs.h~include_prune	2003-10-02 18:07:20.000000000 +0200
    +++ linux-2.6.0-test5/include/linux/fs.h	2003-10-02 18:09:41.000000000 +0200
    @@ -6,20 +6,11 @@
      * structures etc.
      */
     
    -#include <linux/config.h>
    -#include <linux/linkage.h>
    -#include <linux/limits.h>
    -#include <linux/wait.h>
    -#include <linux/types.h>
     #include <linux/kdev_t.h>
    -#include <linux/ioctl.h>
    -#include <linux/list.h>
     #include <linux/dcache.h>
     #include <linux/stat.h>
    -#include <linux/cache.h>
     #include <linux/radix-tree.h>
     #include <linux/kobject.h>
    -#include <asm/atomic.h>
     
     struct iovec;
     struct nameidata;
    @@ -208,7 +199,6 @@
     #ifdef __KERNEL__
     
     #include <asm/semaphore.h>
    -#include <asm/byteorder.h>
     
     /* Used to be a macro which just called the function, now just a function */
     extern void update_atime (struct inode *);
    @@ -1236,8 +1226,6 @@
     extern int is_subdir(struct dentry *, struct dentry *);
     extern ino_t find_inode_number(struct dentry *, struct qstr *);
     
    -#include <linux/err.h>
    -
     /* needed for stackable file system support */
     extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
     
    -
    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/
    

  • Next message: Randy.Dunlap: "Re: [PATCH] export [__]set_special_pids()"

    Relevant Pages

    • RE: [PATCH][2.4.30-rc1] updated gcc-4.0 patches
      ... -extern volatile struct OpenPIC *OpenPIC; ... extern struct cpuinfo_x86 boot_cpu_data; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] rmap 6 swap_unplug page
      ... to unplug all swap devices. ... extern int swap_readpage(struct file *, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Linux 2.6.0-test6
      ... and gcc warns that "struct task_struct" has not been declared, ... Just declare the structure ... everything being rebuilt just because one header file was touched. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH][3/11] IB: sparse fixes
      ... Fix some sparse warnings by making sure we have appropriate "extern" ... struct ib_pkey_cache { ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.11-mm3 breaks compile of drivers/char/esp.c
      ... Seems that Alan's diff was missing the changes to the header file. ... struct esp_struct { ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)