diff options
author | Tejun Heo <tj@kernel.org> | 2010-03-24 04:04:11 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-03-30 09:02:32 -0400 |
commit | 5a0e3ad6af8660be21ca98a971cd00f331318c05 (patch) | |
tree | 5bfb7be11a03176a87296a43ac6647975c00a1d1 /net/irda | |
parent | ed391f4ebf8f701d3566423ce8f17e614cde9806 (diff) |
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/af_irda.c | 1 | ||||
-rw-r--r-- | net/irda/discovery.c | 1 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_core.c | 1 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_lmp.c | 1 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_param.c | 1 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 1 | ||||
-rw-r--r-- | net/irda/irda_device.c | 1 | ||||
-rw-r--r-- | net/irda/iriap.c | 1 | ||||
-rw-r--r-- | net/irda/iriap_event.c | 2 | ||||
-rw-r--r-- | net/irda/irias_object.c | 1 | ||||
-rw-r--r-- | net/irda/irlan/irlan_client.c | 1 | ||||
-rw-r--r-- | net/irda/irlan/irlan_common.c | 1 | ||||
-rw-r--r-- | net/irda/irlan/irlan_provider.c | 1 | ||||
-rw-r--r-- | net/irda/irlap_event.c | 1 | ||||
-rw-r--r-- | net/irda/irlap_frame.c | 1 | ||||
-rw-r--r-- | net/irda/irnet/irnet_irda.c | 1 | ||||
-rw-r--r-- | net/irda/irnet/irnet_ppp.c | 1 | ||||
-rw-r--r-- | net/irda/irnetlink.c | 1 | ||||
-rw-r--r-- | net/irda/irqueue.c | 1 | ||||
-rw-r--r-- | net/irda/irttp.c | 1 |
20 files changed, 21 insertions, 0 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 10093aab6173..2a4efcea3423 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/smp_lock.h> | 48 | #include <linux/smp_lock.h> |
49 | #include <linux/socket.h> | 49 | #include <linux/socket.h> |
50 | #include <linux/sockios.h> | 50 | #include <linux/sockios.h> |
51 | #include <linux/slab.h> | ||
51 | #include <linux/init.h> | 52 | #include <linux/init.h> |
52 | #include <linux/net.h> | 53 | #include <linux/net.h> |
53 | #include <linux/irda.h> | 54 | #include <linux/irda.h> |
diff --git a/net/irda/discovery.c b/net/irda/discovery.c index a6f99b5a1499..c1c8ae939126 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/socket.h> | 34 | #include <linux/socket.h> |
35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | #include <net/irda/irda.h> | 39 | #include <net/irda/irda.h> |
39 | #include <net/irda/irlmp.h> | 40 | #include <net/irda/irlmp.h> |
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 018c92941aba..e97082017f4f 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/slab.h> | ||
36 | 37 | ||
37 | #include <net/irda/irda.h> | 38 | #include <net/irda/irda.h> |
38 | #include <net/irda/irmod.h> | 39 | #include <net/irda/irmod.h> |
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index 7ba96618660e..08fb54dc8c41 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | ********************************************************************/ | 31 | ********************************************************************/ |
32 | 32 | ||
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/gfp.h> | ||
34 | 35 | ||
35 | #include <net/irda/irda.h> | 36 | #include <net/irda/irda.h> |
36 | #include <net/irda/irlmp.h> | 37 | #include <net/irda/irlmp.h> |
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index d57aefd9fe77..e2e893b474e9 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c | |||
@@ -28,6 +28,7 @@ | |||
28 | * | 28 | * |
29 | ********************************************************************/ | 29 | ********************************************************************/ |
30 | 30 | ||
31 | #include <linux/gfp.h> | ||
31 | #include <linux/workqueue.h> | 32 | #include <linux/workqueue.h> |
32 | #include <linux/interrupt.h> | 33 | #include <linux/interrupt.h> |
33 | 34 | ||
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 8b85d774e47f..faa82ca2dfdc 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
36 | #include <linux/slab.h> | ||
36 | #include <linux/sched.h> | 37 | #include <linux/sched.h> |
37 | #include <linux/seq_file.h> | 38 | #include <linux/seq_file.h> |
38 | #include <linux/termios.h> | 39 | #include <linux/termios.h> |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index bf92e1473447..25cc2e695158 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/tty.h> | 41 | #include <linux/tty.h> |
42 | #include <linux/kmod.h> | 42 | #include <linux/kmod.h> |
43 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
44 | #include <linux/slab.h> | ||
44 | 45 | ||
45 | #include <asm/ioctls.h> | 46 | #include <asm/ioctls.h> |
46 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 294e34d3517c..79a1e5a23e10 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/string.h> | 31 | #include <linux/string.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
34 | #include <linux/slab.h> | ||
34 | 35 | ||
35 | #include <asm/byteorder.h> | 36 | #include <asm/byteorder.h> |
36 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
diff --git a/net/irda/iriap_event.c b/net/irda/iriap_event.c index a301cbd93785..703774e29e32 100644 --- a/net/irda/iriap_event.c +++ b/net/irda/iriap_event.c | |||
@@ -24,6 +24,8 @@ | |||
24 | * | 24 | * |
25 | ********************************************************************/ | 25 | ********************************************************************/ |
26 | 26 | ||
27 | #include <linux/slab.h> | ||
28 | |||
27 | #include <net/irda/irda.h> | 29 | #include <net/irda/irda.h> |
28 | #include <net/irda/irlmp.h> | 30 | #include <net/irda/irlmp.h> |
29 | #include <net/irda/iriap.h> | 31 | #include <net/irda/iriap.h> |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 99ebb96f1386..f07ed9fd5792 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -22,6 +22,7 @@ | |||
22 | * | 22 | * |
23 | ********************************************************************/ | 23 | ********************************************************************/ |
24 | 24 | ||
25 | #include <linux/slab.h> | ||
25 | #include <linux/string.h> | 26 | #include <linux/string.h> |
26 | #include <linux/socket.h> | 27 | #include <linux/socket.h> |
27 | #include <linux/module.h> | 28 | #include <linux/module.h> |
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 42f7d960d055..7ed3af957935 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/string.h> | 30 | #include <linux/string.h> |
31 | #include <linux/slab.h> | ||
31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
33 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index e486dc89ea59..a788f9e9427d 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/string.h> | 29 | #include <linux/string.h> |
30 | #include <linux/gfp.h> | ||
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
32 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 3f81f81b2dfa..5cf5e6c872bb 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
35 | #include <linux/random.h> | 35 | #include <linux/random.h> |
36 | #include <linux/bitops.h> | 36 | #include <linux/bitops.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | #include <asm/system.h> | 39 | #include <asm/system.h> |
39 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index 94a9884d7146..d434c8880745 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | #include <net/irda/irda.h> | 34 | #include <net/irda/irda.h> |
34 | #include <net/irda/irlap_event.h> | 35 | #include <net/irda/irlap_event.h> |
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 7af2e74deda8..688222cbf55b 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/if_ether.h> | 29 | #include <linux/if_ether.h> |
30 | #include <linux/netdevice.h> | 30 | #include <linux/netdevice.h> |
31 | #include <linux/irda.h> | 31 | #include <linux/irda.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | #include <net/pkt_sched.h> | 34 | #include <net/pkt_sched.h> |
34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c index b26dee784aba..df18ab4b6c5e 100644 --- a/net/irda/irnet/irnet_irda.c +++ b/net/irda/irnet/irnet_irda.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "irnet_irda.h" /* Private header */ | 11 | #include "irnet_irda.h" /* Private header */ |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
14 | #include <linux/slab.h> | ||
14 | #include <asm/unaligned.h> | 15 | #include <asm/unaligned.h> |
15 | 16 | ||
16 | /* | 17 | /* |
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 6b3602de359a..6a1a202710c5 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
@@ -14,6 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/slab.h> | ||
17 | #include <linux/smp_lock.h> | 18 | #include <linux/smp_lock.h> |
18 | #include "irnet_ppp.h" /* Private header */ | 19 | #include "irnet_ppp.h" /* Private header */ |
19 | /* Please put other headers in irnet.h - Thanks */ | 20 | /* Please put other headers in irnet.h - Thanks */ |
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index 69b5b75f5431..6c7c4b92e4f8 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/socket.h> | 16 | #include <linux/socket.h> |
17 | #include <linux/irda.h> | 17 | #include <linux/irda.h> |
18 | #include <linux/gfp.h> | ||
18 | #include <net/net_namespace.h> | 19 | #include <net/net_namespace.h> |
19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
20 | #include <net/irda/irda.h> | 21 | #include <net/irda/irda.h> |
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c index ba01938becb5..849aaf0dabb5 100644 --- a/net/irda/irqueue.c +++ b/net/irda/irqueue.c | |||
@@ -192,6 +192,7 @@ | |||
192 | * Jean II | 192 | * Jean II |
193 | */ | 193 | */ |
194 | #include <linux/module.h> | 194 | #include <linux/module.h> |
195 | #include <linux/slab.h> | ||
195 | 196 | ||
196 | #include <net/irda/irda.h> | 197 | #include <net/irda/irda.h> |
197 | #include <net/irda/irqueue.h> | 198 | #include <net/irda/irqueue.h> |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 9cb79f95bf63..47db1d8a0d92 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
31 | #include <linux/slab.h> | ||
31 | 32 | ||
32 | #include <asm/byteorder.h> | 33 | #include <asm/byteorder.h> |
33 | #include <asm/unaligned.h> | 34 | #include <asm/unaligned.h> |