Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756150AbXJ0TsX (ORCPT ); Sat, 27 Oct 2007 15:48:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752030AbXJ0TsM (ORCPT ); Sat, 27 Oct 2007 15:48:12 -0400 Received: from ug-out-1314.google.com ([66.249.92.170]:41411 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbXJ0TsH (ORCPT ); Sat, 27 Oct 2007 15:48:07 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:cc:subject:message-id:mime-version:content-type:content-disposition:user-agent:from; b=hJ3GD6HcNSb2mVAby/aTb6wpAKdwj8ngYPrb8CjJ8+n374RBakBP9//9Zy3q4wRp8lEvZTpnftBkNjgQ4nhHwfFGFrxoWq4CNVqHZEeZzlwpyqagyA8sZZy6v95pCjp3+Lf5C/CwqV6vMwxCFBq5h8pvhy4F1UlrRtFb5piUz00= Date: Sat, 27 Oct 2007 23:47:58 +0400 To: akpm@osdl.org, torvalds@osdl.org Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH] proc_fs.h redux Message-ID: <20071027194758.GD9816@martell.zuzino.mipt.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) From: Alexey Dobriyan Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 22007 Lines: 784 Remove proc_fs.h from headers that doesn't really need it. Typical overkill is including full header when one can get away with just forward declaration of "struct proc_dir_entry". Number of files that are recompiled after touching proc_fs.h drops from 1100 to 513(!) on x86_64 allmodconfig. Signed-off-by: Alexey Dobriyan --- arch/powerpc/kernel/process.c | 1 + arch/powerpc/kernel/prom.c | 1 + arch/powerpc/mm/init_32.c | 1 + arch/powerpc/mm/init_64.c | 1 + arch/powerpc/platforms/iseries/mf.c | 1 + arch/powerpc/platforms/pasemi/electra_ide.c | 2 +- arch/powerpc/sysdev/fsl_soc.c | 1 + arch/powerpc/sysdev/mv64x60_dev.c | 2 +- arch/powerpc/sysdev/qe_lib/qe.c | 1 + arch/sparc/kernel/process.c | 3 ++- arch/sparc64/kernel/ldc.c | 1 + arch/sparc64/kernel/mdesc.c | 1 + arch/sparc64/kernel/viohs.c | 2 +- drivers/acpi/bay.c | 1 + drivers/acpi/dock.c | 2 +- drivers/block/cpqarray.h | 2 +- drivers/hwmon/ibmpex.c | 2 +- drivers/isdn/hardware/eicon/platform.h | 1 - drivers/md/md.c | 1 + drivers/misc/fujitsu-laptop.c | 1 + drivers/misc/msi-laptop.c | 1 + drivers/misc/thinkpad_acpi.c | 2 +- drivers/misc/thinkpad_acpi.h | 3 ++- drivers/net/bonding/bonding.h | 3 ++- drivers/net/cxgb3/t3cdev.h | 2 +- drivers/parport/parport_serial.c | 2 +- drivers/sbus/char/envctrl.c | 2 +- drivers/sbus/char/uctrl.c | 1 + drivers/scsi/imm.h | 1 - drivers/scsi/ppa.h | 1 - drivers/usb/gadget/lh7a40x_udc.h | 1 - fs/nfs/client.c | 1 + include/acpi/acpi_bus.h | 2 +- include/asm-powerpc/prom.h | 3 ++- include/asm-sparc/prom.h | 4 +++- include/asm-sparc64/prom.h | 4 +++- include/linux/atmdev.h | 2 +- include/linux/crash_dump.h | 3 ++- include/linux/efi.h | 1 - include/linux/ipmi.h | 1 - include/linux/netfilter.h | 2 +- include/linux/parport.h | 1 - include/linux/raid/md.h | 1 - include/linux/sunrpc/cache.h | 4 +++- include/linux/sunrpc/rpc_pipe_fs.h | 2 ++ include/linux/sunrpc/stats.h | 3 ++- include/linux/wanrouter.h | 3 ++- include/net/sctp/sctp.h | 2 +- net/atm/br2684.c | 1 + net/atm/resources.h | 2 -- net/irda/irnet/irnet.h | 1 - net/irda/irnet/irnet_irda.c | 2 +- net/sctp/objcnt.c | 1 + net/sctp/proc.c | 1 + net/sctp/protocol.c | 1 + net/sunrpc/auth.c | 2 ++ net/sunrpc/auth_unix.c | 2 +- net/sunrpc/rpcb_clnt.c | 1 + net/sunrpc/xprt.c | 2 +- net/wanrouter/wanmain.c | 1 + net/wanrouter/wanproc.c | 1 + 61 files changed, 66 insertions(+), 38 deletions(-) --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include --- a/arch/powerpc/platforms/pasemi/electra_ide.c +++ b/arch/powerpc/platforms/pasemi/electra_ide.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include #include --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include --- a/arch/powerpc/sysdev/mv64x60_dev.c +++ b/arch/powerpc/sysdev/mv64x60_dev.c @@ -8,7 +8,7 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ - +#include #include #include #include --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c @@ -14,6 +14,7 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ +#include #include #include #include --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -10,12 +10,13 @@ */ #include - +#include #include #include #include #include #include +#include #include #include #include --- a/arch/sparc64/kernel/ldc.c +++ b/arch/sparc64/kernel/ldc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include --- a/arch/sparc64/kernel/mdesc.c +++ b/arch/sparc64/kernel/mdesc.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include --- a/arch/sparc64/kernel/viohs.c +++ b/arch/sparc64/kernel/viohs.c @@ -2,7 +2,7 @@ * * Copyright (C) 2007 David S. Miller */ - +#include #include #include #include --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -21,7 +21,7 @@ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - +#include #include #include #include --- a/drivers/block/cpqarray.h +++ b/drivers/block/cpqarray.h @@ -28,7 +28,6 @@ #ifdef __KERNEL__ #include #include -#include #include #endif @@ -57,6 +56,7 @@ typedef struct { struct ctlr_info; typedef struct ctlr_info ctlr_info_t; +struct proc_dir_entry; struct access_method { void (*submit_command)(ctlr_info_t *h, cmdlist_t *c); --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include #include #include --- a/drivers/isdn/hardware/eicon/platform.h +++ b/drivers/isdn/hardware/eicon/platform.h @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -41,6 +41,7 @@ #include #include /* for invalidate_bdev */ #include +#include #include #include #include --- a/drivers/misc/fujitsu-laptop.c +++ b/drivers/misc/fujitsu-laptop.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include --- a/drivers/misc/msi-laptop.c +++ b/drivers/misc/msi-laptop.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -81,7 +81,7 @@ * removed fan control, currently useless * 2004-08-09 0.1 initial release, support for X series */ - +#include #include "thinkpad_acpi.h" MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh"); --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -52,6 +51,8 @@ #include +struct proc_dir_entry; + /**************************************************************************** * Main driver */ --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -16,12 +16,13 @@ #define _LINUX_BONDING_H #include -#include #include #include #include "bond_3ad.h" #include "bond_alb.h" +struct proc_dir_entry; + #define DRV_VERSION "3.2.1" #define DRV_RELDATE "October 15, 2007" #define DRV_NAME "bonding" --- a/drivers/net/cxgb3/t3cdev.h +++ b/drivers/net/cxgb3/t3cdev.h @@ -36,13 +36,13 @@ #include #include #include -#include #include #include #define T3CNAMSIZ 16 struct cxgb3_client; +struct proc_dir_entry; enum t3ctype { T3A = 0, --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -16,7 +16,7 @@ * that. * */ - +#include #include #include #include --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -18,7 +18,7 @@ * DB - Audit every copy_to_user in envctrl_read. * Daniele Bellucci */ - +#include #include #include #include --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include --- a/drivers/scsi/imm.h +++ b/drivers/scsi/imm.h @@ -71,7 +71,6 @@ #include #include #include -#include #include #include #include --- a/drivers/scsi/ppa.h +++ b/drivers/scsi/ppa.h @@ -78,7 +78,6 @@ #include #include #include -#include #include #include #include --- a/drivers/usb/gadget/lh7a40x_udc.h +++ b/drivers/usb/gadget/lh7a40x_udc.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -55,7 +55,7 @@ acpi_evaluate_reference(acpi_handle handle, #ifdef CONFIG_ACPI -#include +struct proc_dir_entry; #define ACPI_BUS_FILE_ROOT "acpi" extern struct proc_dir_entry *acpi_root_dir; --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -16,11 +16,12 @@ * 2 of the License, or (at your option) any later version. */ #include -#include #include #include #include +struct proc_dir_entry; + #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 --- a/include/asm-sparc/prom.h +++ b/include/asm-sparc/prom.h @@ -17,9 +17,11 @@ * 2 of the License, or (at your option) any later version. */ #include -#include +#include #include +struct proc_dir_entry; + #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 --- a/include/asm-sparc64/prom.h +++ b/include/asm-sparc64/prom.h @@ -17,9 +17,11 @@ * 2 of the License, or (at your option) any later version. */ #include -#include +#include #include +struct proc_dir_entry; + #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -219,7 +219,7 @@ struct atm_cirange { #include #ifdef CONFIG_PROC_FS -#include +struct proc_dir_entry; extern struct proc_dir_entry *atm_proc_root; #endif --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h @@ -5,7 +5,8 @@ #include #include #include -#include + +struct proc_dir_entry; #define ELFCORE_ADDR_MAX (-1ULL) extern unsigned long long elfcorehdr_addr; --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -226,7 +226,6 @@ struct kernel_ipmi_msg #include #include #include -#include /* Opaque type for a IPMI message user. One of these is needed to send and receive messages. */ --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -363,7 +363,7 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) } #ifdef CONFIG_PROC_FS -#include +struct proc_dir_entry; extern struct proc_dir_entry *proc_net_netfilter; #endif --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -97,7 +97,6 @@ typedef enum { #ifdef __KERNEL__ #include -#include #include #include #include --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -13,9 +13,11 @@ #ifndef _LINUX_SUNRPC_CACHE_H_ #define _LINUX_SUNRPC_CACHE_H_ +#include #include #include -#include + +struct proc_dir_entry; /* * Each cache requires: --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h @@ -3,6 +3,8 @@ #ifdef __KERNEL__ +#include + struct rpc_pipe_msg { struct list_head list; void *data; --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h @@ -9,7 +9,8 @@ #ifndef _LINUX_SUNRPC_STATS_H #define _LINUX_SUNRPC_STATS_H -#include +struct file_operations; +struct proc_dir_entry; struct rpc_stat { struct rpc_program * program; --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -453,10 +453,11 @@ typedef struct wanif_conf /****** Kernel Interface ****************************************************/ #include /* support for device drivers */ -#include /* proc filesystem pragmatics */ #include /* support for network drivers */ #include /* Support for SMP Locking */ +struct proc_dir_entry; + /*---------------------------------------------------------------------------- * WAN device data space. */ --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -74,7 +74,6 @@ #include #include #include -#include #include #include #include @@ -91,6 +90,7 @@ #include #include +struct proc_dir_entry; /* Set SCTP_DEBUG flag via config if not already set. */ #ifndef SCTP_DEBUG --- a/net/atm/br2684.c +++ b/net/atm/br2684.c @@ -18,6 +18,7 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary #include #include #include +#include #include #include --- a/net/atm/resources.h +++ b/net/atm/resources.h @@ -18,8 +18,6 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg); #ifdef CONFIG_PROC_FS -#include - void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos); void atm_dev_seq_stop(struct seq_file *seq, void *v); void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); --- a/net/irda/irnet/irnet.h +++ b/net/irda/irnet/irnet.h @@ -243,7 +243,6 @@ #include #include #include -#include #include #include #include --- a/net/irda/irnet/irnet_irda.c +++ b/net/irda/irnet/irnet_irda.c @@ -7,7 +7,7 @@ * Basically, we sit on top of IrTTP. We set up IrTTP, IrIAS properly, * and exchange frames with IrTTP. */ - +#include #include "irnet_irda.h" /* Private header */ /* --- a/net/sctp/objcnt.c +++ b/net/sctp/objcnt.c @@ -39,6 +39,7 @@ */ #include +#include #include /* --- a/net/sctp/proc.c +++ b/net/sctp/proc.c @@ -35,6 +35,7 @@ */ #include +#include #include #include #include --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -7,9 +7,11 @@ */ #include +#include #include #include #include +#include #include #include #include --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c @@ -5,7 +5,7 @@ * * Copyright (C) 1996, Olaf Kirch */ - +#include #include #include #include --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -37,7 +37,7 @@ */ #include - +#include #include #include #include --- a/net/wanrouter/wanmain.c +++ b/net/wanrouter/wanmain.c @@ -49,6 +49,7 @@ #include /* support for loadable modules */ #include /* kmalloc(), kfree() */ #include +#include #include /* inline mem*, str* functions */ #include /* htons(), etc. */ --- a/net/wanrouter/wanproc.c +++ b/net/wanrouter/wanproc.c @@ -26,6 +26,7 @@ #include #include #include /* WAN router API definitions */ +#include #include #include - 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/