Re: [Bug 352] New: Unneccessary includes of linux/version.h

From: Valdis.Kletnieks@vt.edu
Date: Thu Feb 13 2003 - 15:57:59 EST


On Thu, 13 Feb 2003 12:13:08 PST, "Martin J. Bligh" <mbligh@aracnet.com> said:

> There appears to be a large number of kernel files (267) that #include
> <linux/version.h>, but do not use any of the three things defined in it.
> This causes these files to be needlessly(I think) recompiled during a
> kernel rebuild if only the version.h file changes. Would a patch to remove
> these extra includes be accepted?
>
> Here is the list (generated with a script, so it could be wrong..)

Did your script include tracing of second-order effects?

The following reference one of the 3 version.h variables but don't include
linux/version.h themselves:

include/linux/coda.h
include/linux/compile.h
include/linux/cyclomx.h
include/linux/istallion.h
include/linux/mtd/cfi.h
include/linux/netfilter_ipv4/ipchains_core.h
include/linux/serialP.h
include/linux/stallion.h
include/linux/videodev2.h
include/net/irda/vlsi_ir.h

So for instance, the ipchains_core.h may explain these files in your list:

/net/ipv4/netfilter/ip_conntrack_core.c
/net/ipv4/netfilter/ip_nat_core.c
/net/ipv4/netfilter/ip_nat_helper.c
/net/ipv4/netfilter/ipt_ULOG.c
/net/ipv4/netfilter/ip_nat_rule.c
/net/ipv4/netfilter/ip_conntrack_standalone.c
/net/ipv4/netfilter/ip_nat_standalone.c
/net/ipv4/netfilter/ip_fw_compat_masq.c

because *somebody* needs to include version.h.

So a patch may be needed, but it should add the #include to the .h file while
cleaning up the .c files. On the other hand, I'll let somebody who understands
the kernel build system better than I comment on what happens to dependencies
and whether the files that *appear* to be gratuitously rebuilt in fact do need
to be rebuilt....



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



This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:49 EST