linux/drivers/serial
Tejun Heo 5a0e3ad6af 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>
2010-03-30 22:02:32 +09:00
..
cpm_uart include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
jsm include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
8250_accent.c
8250_acorn.c
8250_boca.c
8250_early.c
8250_exar_st16c554.c
8250_fourport.c
8250_gsc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
8250_hp300.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
8250_hub6.c
8250_mca.c
8250_pci.c serial: add support for Korenix JetCard 2010-03-02 14:43:10 -08:00
8250_pnp.c serial: 8250_pnp: use wildcard for serial Wacom tablets 2010-01-20 15:03:27 -08:00
8250.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
8250.h serial: 8250: add IRQ trigger support 2009-09-19 13:13:19 -07:00
21285.c ARM: 5874/1: serial21285: fix disable_irq-from-interrupt-handler deadlock 2010-01-11 15:39:21 +00:00
68328serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
68328serial.h
68360serial.c
amba-pl010.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
amba-pl011.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
apbuart.c apbuart: Use of_find_node_by_path to find root node. 2009-11-13 13:25:06 -08:00
apbuart.h sparc: Support for GRLIB APBUART serial port 2009-11-04 08:44:54 -08:00
atmel_serial.c serial: atmel_serial: add poll_get_char and poll_put_char uart_ops 2010-03-02 14:43:08 -08:00
bcm63xx_uart.c serial: bcm63xx_uart: allow more than one uart to be registered. 2010-03-02 14:43:19 -08:00
bfin_5xx.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
bfin_sport_uart.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
bfin_sport_uart.h serial: fit blackfin uart over sport driver into common uart infrastructure 2010-03-02 14:43:06 -08:00
clps711x.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
crisv10.c CRIS: fix defconfig build failure 2009-08-31 18:38:16 +02:00
crisv10.h
dz.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
dz.h
icom.c tty: Fix up char drivers request_room usage 2010-03-02 14:43:22 -08:00
icom.h
imx.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ioc3_serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ioc4_serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ip22zilog.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
ip22zilog.h
Kconfig Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
kgdboc.c
m32r_sio_reg.h
m32r_sio.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
m32r_sio.h
Makefile ARM: S5PV210: Add serial port support 2010-01-26 09:50:01 +09:00
max3100.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mcf.c m68knommu: move mcf_remove to .devexit.text 2009-12-04 11:45:30 +10:00
mpc52xx_uart.c serial: mpc52xx_uart: re-enable mpc5121 PSC UART support 2010-02-16 22:30:03 -07:00
mpsc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
msm_serial.c serial: fix test of unsigned 2010-03-02 14:43:11 -08:00
msm_serial.h msm_serial: serial driver for MSM7K onboard serial peripheral. 2009-06-22 11:32:25 -07:00
mux.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
netx-serial.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
nwpserial.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
of_serial.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pmac_zilog.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pmac_zilog.h pmac-zilog: add platform driver 2010-02-27 18:31:02 +01:00
pnx8xxx_uart.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
pxa.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
s3c24a0.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c2400.c ARM: S3C24XX: serial: Fix section mismatch warnings 2009-07-30 23:56:41 +01:00
s3c2410.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c2412.c ARM: S3C2412: SoC has the fractional baud rate register 2010-02-03 01:55:01 +00:00
s3c2440.c ARM: S3C: Update Simtec copyright statements from , to - [2] 2009-12-01 01:33:51 +00:00
s3c6400.c ARM: S3C64XX: serial: Fix section mismatch warning 2009-07-30 23:56:41 +01:00
s5pv210.c ARM: S5PV210: Add serial port support 2010-01-26 09:50:01 +09:00
sa1100.c ARM: Fix SA1100 Neponset serial section mismatch 2009-09-28 18:06:16 +01:00
samsung.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
samsung.h ARM: SAMSUNG: serial: Modify console initialization. 2010-01-19 17:50:47 +09:00
sb1250-duart.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
sc26xx.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
serial_core.c serial: Fix crash if the minimum rate of the device is > 9600 baud 2010-01-20 15:03:29 -08:00
serial_cs.c pcnet_cs: add new id 2010-03-27 16:41:28 -07:00
serial_ks8695.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
serial_lh7a40x.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
serial_txx9.c serial_txx9: use container_of() instead of direct cast 2009-10-01 16:11:15 -07:00
sh-sci.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sh-sci.h SH: fix SCIFA SCASCR register bit definitions 2010-03-23 13:33:45 +09:00
sn_console.c serial: kill off uart_info 2009-09-19 13:13:28 -07:00
suncore.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
suncore.h serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunhv.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunsab.c drivers/serial/sunsab.c: adjust the constant used to initialize the interrupt_mask0 fields 2010-03-16 00:33:37 -07:00
sunsab.h
sunsu.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sunzilog.c serial: suncore: Fix RSC/LOM handling in sunserial_console_termios(). 2009-11-24 14:09:56 -08:00
sunzilog.h
timbuart.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
timbuart.h
uartlite.c uartlite: Fix build on sparc. 2010-03-19 07:17:54 -07:00
ucc_uart.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vr41xx_siu.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
zs.c serial: move delta_msr_wait into the tty_port 2009-09-19 13:13:31 -07:00
zs.h