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 /drivers/hwmon | |
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 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/ad7414.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/ad7418.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adcxx.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adt7411.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adt7462.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adt7470.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/asus_atk0110.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/atxp1.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/f75375s.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/i5k_amb.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/ibmaem.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/ibmpex.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/lm70.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/lm73.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/max1111.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/mc13783-adc.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/sht15.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/wm831x-hwmon.c | 1 |
18 files changed, 17 insertions, 1 deletions
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c index bfda8c80ef24..1e4c21fc1a89 100644 --- a/drivers/hwmon/ad7414.c +++ b/drivers/hwmon/ad7414.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/err.h> | 27 | #include <linux/err.h> |
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/sysfs.h> | 29 | #include <linux/sysfs.h> |
30 | #include <linux/slab.h> | ||
30 | 31 | ||
31 | 32 | ||
32 | /* AD7414 registers */ | 33 | /* AD7414 registers */ |
diff --git a/drivers/hwmon/ad7418.c b/drivers/hwmon/ad7418.c index f97b5b356875..ffc781fec185 100644 --- a/drivers/hwmon/ad7418.c +++ b/drivers/hwmon/ad7418.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/err.h> | 20 | #include <linux/err.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/slab.h> | ||
23 | 24 | ||
24 | #include "lm75.h" | 25 | #include "lm75.h" |
25 | 26 | ||
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c index 74d9c5195e44..fbdc7655303b 100644 --- a/drivers/hwmon/adcxx.c +++ b/drivers/hwmon/adcxx.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/module.h> | 38 | #include <linux/module.h> |
39 | #include <linux/kernel.h> | 39 | #include <linux/kernel.h> |
40 | #include <linux/slab.h> | ||
40 | #include <linux/device.h> | 41 | #include <linux/device.h> |
41 | #include <linux/err.h> | 42 | #include <linux/err.h> |
42 | #include <linux/sysfs.h> | 43 | #include <linux/sysfs.h> |
diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index 3471884e42d2..4086c7257f91 100644 --- a/drivers/hwmon/adt7411.c +++ b/drivers/hwmon/adt7411.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/hwmon.h> | 22 | #include <linux/hwmon.h> |
23 | #include <linux/hwmon-sysfs.h> | 23 | #include <linux/hwmon-sysfs.h> |
24 | #include <linux/slab.h> | ||
24 | 25 | ||
25 | #define ADT7411_REG_INT_TEMP_VDD_LSB 0x03 | 26 | #define ADT7411_REG_INT_TEMP_VDD_LSB 0x03 |
26 | #define ADT7411_REG_EXT_TEMP_AIN14_LSB 0x04 | 27 | #define ADT7411_REG_EXT_TEMP_AIN14_LSB 0x04 |
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c index b8156b4893bb..2af0c7b6b4e4 100644 --- a/drivers/hwmon/adt7462.c +++ b/drivers/hwmon/adt7462.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/log2.h> | 30 | #include <linux/log2.h> |
31 | #include <linux/slab.h> | ||
31 | 32 | ||
32 | /* Addresses to scan */ | 33 | /* Addresses to scan */ |
33 | static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; | 34 | static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; |
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index 3445ce1cba81..9e775717abb7 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/log2.h> | 30 | #include <linux/log2.h> |
31 | #include <linux/kthread.h> | 31 | #include <linux/kthread.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | /* Addresses to scan */ | 34 | /* Addresses to scan */ |
34 | static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; | 35 | static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; |
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 028284f544e3..75f3fa55663d 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/hwmon.h> | 10 | #include <linux/hwmon.h> |
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/slab.h> | ||
13 | 14 | ||
14 | #include <acpi/acpi.h> | 15 | #include <acpi/acpi.h> |
15 | #include <acpi/acpixf.h> | 16 | #include <acpi/acpixf.h> |
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index 94cadc19f0c5..33cc143b2069 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/err.h> | 28 | #include <linux/err.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/sysfs.h> | 30 | #include <linux/sysfs.h> |
31 | #include <linux/slab.h> | ||
31 | 32 | ||
32 | MODULE_LICENSE("GPL"); | 33 | MODULE_LICENSE("GPL"); |
33 | MODULE_DESCRIPTION("System voltages control via Attansic ATXP1"); | 34 | MODULE_DESCRIPTION("System voltages control via Attansic ATXP1"); |
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 277398f9c938..bad2cf3ef4a4 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
37 | #include <linux/f75375s.h> | 37 | #include <linux/f75375s.h> |
38 | #include <linux/slab.h> | ||
38 | 39 | ||
39 | /* Addresses to scan */ | 40 | /* Addresses to scan */ |
40 | static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; | 41 | static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; |
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index 27d7f72a5f11..e880e2c3871d 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/log2.h> | 30 | #include <linux/log2.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <linux/slab.h> | ||
33 | 34 | ||
34 | #define DRVNAME "i5k_amb" | 35 | #define DRVNAME "i5k_amb" |
35 | 36 | ||
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index 405d3fb5d76f..eaee546af19a 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/kdev_t.h> | 29 | #include <linux/kdev_t.h> |
30 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | #include <linux/slab.h> | ||
32 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
33 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
34 | #include <linux/math64.h> | 35 | #include <linux/math64.h> |
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index a36363312f2f..06d4eafcf76b 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/hwmon-sysfs.h> | 25 | #include <linux/hwmon-sysfs.h> |
26 | #include <linux/jiffies.h> | 26 | #include <linux/jiffies.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/slab.h> | ||
28 | 29 | ||
29 | #define REFRESH_INTERVAL (2 * HZ) | 30 | #define REFRESH_INTERVAL (2 * HZ) |
30 | #define DRVNAME "ibmpex" | 31 | #define DRVNAME "ibmpex" |
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c index ab8a5d3c7690..fd108cfc05c7 100644 --- a/drivers/hwmon/lm70.c +++ b/drivers/hwmon/lm70.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/mod_devicetable.h> | 35 | #include <linux/mod_devicetable.h> |
36 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | 39 | ||
39 | #define DRVNAME "lm70" | 40 | #define DRVNAME "lm70" |
diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index c5f39ba103c0..4d1b76bc8148 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/slab.h> | ||
20 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
21 | #include <linux/hwmon.h> | 20 | #include <linux/hwmon.h> |
22 | #include <linux/hwmon-sysfs.h> | 21 | #include <linux/hwmon-sysfs.h> |
diff --git a/drivers/hwmon/max1111.c b/drivers/hwmon/max1111.c index 9ac497271adf..12a54aa29776 100644 --- a/drivers/hwmon/max1111.c +++ b/drivers/hwmon/max1111.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/hwmon.h> | 20 | #include <linux/hwmon.h> |
21 | #include <linux/hwmon-sysfs.h> | 21 | #include <linux/hwmon-sysfs.h> |
22 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
23 | #include <linux/slab.h> | ||
23 | 24 | ||
24 | #define MAX1111_TX_BUF_SIZE 1 | 25 | #define MAX1111_TX_BUF_SIZE 1 |
25 | #define MAX1111_RX_BUF_SIZE 2 | 26 | #define MAX1111_RX_BUF_SIZE 2 |
diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c index 883fa8197da4..ce3c7bc81814 100644 --- a/drivers/hwmon/mc13783-adc.c +++ b/drivers/hwmon/mc13783-adc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/hwmon.h> | 26 | #include <linux/hwmon.h> |
27 | #include <linux/slab.h> | ||
27 | #include <linux/init.h> | 28 | #include <linux/init.h> |
28 | #include <linux/err.h> | 29 | #include <linux/err.h> |
29 | 30 | ||
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index 864a371f6eb9..6b2d8ae64fe1 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/err.h> | 36 | #include <linux/err.h> |
37 | #include <linux/sht15.h> | 37 | #include <linux/sht15.h> |
38 | #include <linux/regulator/consumer.h> | 38 | #include <linux/regulator/consumer.h> |
39 | #include <linux/slab.h> | ||
39 | #include <asm/atomic.h> | 40 | #include <asm/atomic.h> |
40 | 41 | ||
41 | #define SHT15_MEASURE_TEMP 3 | 42 | #define SHT15_MEASURE_TEMP 3 |
diff --git a/drivers/hwmon/wm831x-hwmon.c b/drivers/hwmon/wm831x-hwmon.c index c16e9e74c356..97b1f834a471 100644 --- a/drivers/hwmon/wm831x-hwmon.c +++ b/drivers/hwmon/wm831x-hwmon.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/hwmon.h> | 25 | #include <linux/hwmon.h> |
26 | #include <linux/hwmon-sysfs.h> | 26 | #include <linux/hwmon-sysfs.h> |
27 | #include <linux/slab.h> | ||
27 | 28 | ||
28 | #include <linux/mfd/wm831x/core.h> | 29 | #include <linux/mfd/wm831x/core.h> |
29 | #include <linux/mfd/wm831x/auxadc.h> | 30 | #include <linux/mfd/wm831x/auxadc.h> |