aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-03-24 04:04:11 -0400
committerTejun Heo <tj@kernel.org>2010-03-30 09:02:32 -0400
commit5a0e3ad6af8660be21ca98a971cd00f331318c05 (patch)
tree5bfb7be11a03176a87296a43ac6647975c00a1d1 /drivers/atm
parented391f4ebf8f701d3566423ce8f17e614cde9806 (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 'drivers/atm')
-rw-r--r--drivers/atm/adummy.c1
-rw-r--r--drivers/atm/ambassador.c1
-rw-r--r--drivers/atm/atmtcp.c1
-rw-r--r--drivers/atm/eni.c1
-rw-r--r--drivers/atm/firestream.c1
-rw-r--r--drivers/atm/he.c1
-rw-r--r--drivers/atm/horizon.c1
-rw-r--r--drivers/atm/idt77105.c1
-rw-r--r--drivers/atm/idt77252.c1
-rw-r--r--drivers/atm/iphase.c1
-rw-r--r--drivers/atm/lanai.c1
-rw-r--r--drivers/atm/nicstar.c1
-rw-r--r--drivers/atm/solos-pci.c1
-rw-r--r--drivers/atm/suni.c1
-rw-r--r--drivers/atm/uPD98402.c1
-rw-r--r--drivers/atm/zatm.c1
16 files changed, 16 insertions, 0 deletions
diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index 5effec6f5458..6d44f07b69f8 100644
--- a/drivers/atm/adummy.c
+++ b/drivers/atm/adummy.c
@@ -13,6 +13,7 @@
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/timer.h> 14#include <linux/timer.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/slab.h>
16#include <asm/io.h> 17#include <asm/io.h>
17#include <asm/byteorder.h> 18#include <asm/byteorder.h>
18#include <asm/uaccess.h> 19#include <asm/uaccess.h>
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 8af23411743c..9d18644c897e 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -36,6 +36,7 @@
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/firmware.h> 37#include <linux/firmware.h>
38#include <linux/ihex.h> 38#include <linux/ihex.h>
39#include <linux/slab.h>
39 40
40#include <asm/atomic.h> 41#include <asm/atomic.h>
41#include <asm/io.h> 42#include <asm/io.h>
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
index 02ad83d6b562..b86712167eb8 100644
--- a/drivers/atm/atmtcp.c
+++ b/drivers/atm/atmtcp.c
@@ -9,6 +9,7 @@
9#include <linux/atm_tcp.h> 9#include <linux/atm_tcp.h>
10#include <linux/bitops.h> 10#include <linux/bitops.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/slab.h>
12#include <asm/uaccess.h> 13#include <asm/uaccess.h>
13#include <asm/atomic.h> 14#include <asm/atomic.h>
14 15
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 0c3026145443..719ec5a0dca5 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/atm_eni.h> 19#include <linux/atm_eni.h>
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21#include <linux/slab.h>
21#include <asm/system.h> 22#include <asm/system.h>
22#include <asm/io.h> 23#include <asm/io.h>
23#include <asm/atomic.h> 24#include <asm/atomic.h>
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index cd5049af47a9..6e600afd06ae 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -46,6 +46,7 @@
46#include <linux/init.h> 46#include <linux/init.h>
47#include <linux/capability.h> 47#include <linux/capability.h>
48#include <linux/bitops.h> 48#include <linux/bitops.h>
49#include <linux/slab.h>
49#include <asm/byteorder.h> 50#include <asm/byteorder.h>
50#include <asm/system.h> 51#include <asm/system.h>
51#include <asm/string.h> 52#include <asm/string.h>
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index e8c6529dc366..c213e0da0343 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -67,6 +67,7 @@
67#include <linux/timer.h> 67#include <linux/timer.h>
68#include <linux/interrupt.h> 68#include <linux/interrupt.h>
69#include <linux/dma-mapping.h> 69#include <linux/dma-mapping.h>
70#include <linux/slab.h>
70#include <asm/io.h> 71#include <asm/io.h>
71#include <asm/byteorder.h> 72#include <asm/byteorder.h>
72#include <asm/uaccess.h> 73#include <asm/uaccess.h>
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index 4e49021e67ee..54720baa7363 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -40,6 +40,7 @@
40#include <linux/init.h> 40#include <linux/init.h>
41#include <linux/ioport.h> 41#include <linux/ioport.h>
42#include <linux/wait.h> 42#include <linux/wait.h>
43#include <linux/slab.h>
43 44
44#include <asm/system.h> 45#include <asm/system.h>
45#include <asm/io.h> 46#include <asm/io.h>
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index 84672dc57f7a..dab5cf5274fb 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -15,6 +15,7 @@
15#include <linux/capability.h> 15#include <linux/capability.h>
16#include <linux/atm_idt77105.h> 16#include <linux/atm_idt77105.h>
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/slab.h>
18#include <asm/system.h> 19#include <asm/system.h>
19#include <asm/param.h> 20#include <asm/param.h>
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 01f36c08cb52..98657a6a330d 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -41,6 +41,7 @@
41#include <linux/wait.h> 41#include <linux/wait.h>
42#include <linux/jiffies.h> 42#include <linux/jiffies.h>
43#include <linux/mutex.h> 43#include <linux/mutex.h>
44#include <linux/slab.h>
44 45
45#include <asm/io.h> 46#include <asm/io.h>
46#include <asm/uaccess.h> 47#include <asm/uaccess.h>
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 25a4c86f839b..ee9ddeb53417 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -54,6 +54,7 @@
54#include <linux/uio.h> 54#include <linux/uio.h>
55#include <linux/init.h> 55#include <linux/init.h>
56#include <linux/wait.h> 56#include <linux/wait.h>
57#include <linux/slab.h>
57#include <asm/system.h> 58#include <asm/system.h>
58#include <asm/io.h> 59#include <asm/io.h>
59#include <asm/atomic.h> 60#include <asm/atomic.h>
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 23d95054705b..cbe15a86c669 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -55,6 +55,7 @@
55 */ 55 */
56 56
57#include <linux/module.h> 57#include <linux/module.h>
58#include <linux/slab.h>
58#include <linux/mm.h> 59#include <linux/mm.h>
59#include <linux/atmdev.h> 60#include <linux/atmdev.h>
60#include <asm/io.h> 61#include <asm/io.h>
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 50838407b117..b7473a6110a7 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -49,6 +49,7 @@
49#include <linux/timer.h> 49#include <linux/timer.h>
50#include <linux/interrupt.h> 50#include <linux/interrupt.h>
51#include <linux/bitops.h> 51#include <linux/bitops.h>
52#include <linux/slab.h>
52#include <asm/io.h> 53#include <asm/io.h>
53#include <asm/uaccess.h> 54#include <asm/uaccess.h>
54#include <asm/atomic.h> 55#include <asm/atomic.h>
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 51eed679a059..ded76c4c9f4f 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -40,6 +40,7 @@
40#include <linux/firmware.h> 40#include <linux/firmware.h>
41#include <linux/ctype.h> 41#include <linux/ctype.h>
42#include <linux/swab.h> 42#include <linux/swab.h>
43#include <linux/slab.h>
43 44
44#define VERSION "0.07" 45#define VERSION "0.07"
45#define PTAG "solos-pci" 46#define PTAG "solos-pci"
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
index 6dd3f5919968..da4b91ffa53e 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/capability.h> 22#include <linux/capability.h>
23#include <linux/atm_suni.h> 23#include <linux/atm_suni.h>
24#include <linux/slab.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/param.h> 26#include <asm/param.h>
26#include <asm/uaccess.h> 27#include <asm/uaccess.h>
diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
index fc8cb07c2477..c45ae0573bbd 100644
--- a/drivers/atm/uPD98402.c
+++ b/drivers/atm/uPD98402.c
@@ -9,6 +9,7 @@
9#include <linux/atmdev.h> 9#include <linux/atmdev.h>
10#include <linux/sonet.h> 10#include <linux/sonet.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/slab.h>
12#include <asm/uaccess.h> 13#include <asm/uaccess.h>
13#include <asm/atomic.h> 14#include <asm/atomic.h>
14 15
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 2e9635be048c..702accec89e9 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -21,6 +21,7 @@
21#include <linux/capability.h> 21#include <linux/capability.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/wait.h> 23#include <linux/wait.h>
24#include <linux/slab.h>
24#include <asm/byteorder.h> 25#include <asm/byteorder.h>
25#include <asm/system.h> 26#include <asm/system.h>
26#include <asm/string.h> 27#include <asm/string.h>