linux/arch/arm
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
..
boot ARM: 5990/1: ARM: use __armv5tej_mmu_cache_flush for V5TEJ instead of __armv4_mmu_cache_flush 2010-03-15 14:32:02 +00:00
common 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
configs Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-03-18 16:59:30 -07:00
include/asm ARM: 5988/1: pgprot_dmacoherent() for non-mmu builds 2010-03-13 10:48:22 +00:00
kernel 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
lib 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
mach-aaec2000 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
mach-at91 ARM: 5986/1: at91sam9g20-ek: Correct braces in I2C registration code 2010-03-13 10:48:21 +00:00
mach-bcmring 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
mach-clps711x ARM: 5910/1: ARM: Add tmp register for addruart and loadsp 2010-02-12 17:27:52 +00:00
mach-davinci 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
mach-dove Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-ebsa110 ARM: 5910/1: ARM: Add tmp register for addruart and loadsp 2010-02-12 17:27:52 +00:00
mach-ep93xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
mach-footbridge Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-gemini Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
mach-h720x 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
mach-integrator 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
mach-iop13xx 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
mach-iop32x 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
mach-iop33x 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
mach-ixp4xx 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
mach-ixp23xx 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
mach-ixp2000 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
mach-kirkwood 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
mach-ks8695 ARM: 5910/1: ARM: Add tmp register for addruart and loadsp 2010-02-12 17:27:52 +00:00
mach-l7200 ARM: 5910/1: ARM: Add tmp register for addruart and loadsp 2010-02-12 17:27:52 +00:00
mach-lh7a40x 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
mach-loki Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-mmp [ARM] mmp: fix for variables in uncompress.h being discarded 2010-03-22 12:03:05 +08:00
mach-msm Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-mv78xx0 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx1 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx2 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx3 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
mach-mx5 mx51_babbage: Fix ckih2 parameter in mx51_clocks_init function 2010-02-24 10:29:14 +01:00
mach-mx25 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mxc91231 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-netx 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
mach-nomadik 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
mach-ns9xxx 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
mach-nuc93x ARM: 5859/1: Add nuc93x platform support 2010-01-27 22:03:00 +00:00
mach-omap1 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
mach-omap2 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
mach-orion5x 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
mach-pnx4008 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
mach-pxa 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
mach-realview 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
mach-rpc 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
mach-s3c24a0/include/mach Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-s3c64xx 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
mach-s3c2400 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
mach-s3c2410 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
mach-s3c2412 ARM: SAMSUNG: Remove dma-plat.h to allow plat-s3c64xx to be removed 2010-02-21 23:10:35 +00:00
mach-s3c2440 ARM: S3C2440: Fix s3c2440 cpufreq compilation post move. 2010-03-15 22:43:12 +00:00
mach-s3c2443 ARM: Merge next-samsung-s3c2443-clock 2010-03-07 22:56:19 +00:00
mach-s5p6440 ARM: SAMSUNG: Fixup commit 4e6d488af3 2010-03-15 23:11:41 +00:00
mach-s5p6442 ARM: SAMSUNG: Fixup commit 4e6d488af3 2010-03-15 23:11:41 +00:00
mach-s5pc100 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
mach-s5pv210 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-sa1100 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
mach-shark ARM: 5910/1: ARM: Add tmp register for addruart and loadsp 2010-02-12 17:27:52 +00:00
mach-shmobile ARM: mach-shmobile: ap4evb SDHI0 platform data V2 2010-03-15 12:06:47 +09:00
mach-stmp37xx
mach-stmp378x
mach-u300 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
mach-ux500 Merge branch 'master' into for-linus 2010-03-08 20:24:11 +00:00
mach-versatile 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
mach-w90x900 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
mm 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
nwfpe ARM: Kill CONFIG_CPU_32 2009-12-18 16:07:53 +00:00
oprofile ARM: 5901/2: arm/oprofile: reserve the PMU when starting 2010-02-12 17:23:43 +00:00
plat-iop ARM: Add caller information to ioremap 2010-02-15 21:39:11 +00:00
plat-mxc 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
plat-nomadik Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
plat-omap 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
plat-orion [ARM] Orion: fix PCIe inbound window programming when RAM size is not a power of two 2009-12-28 23:50:49 -05:00
plat-pxa 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
plat-s3c24xx 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
plat-s5p ARM: S5PV210: Update Kconfig and Makefiles 2010-02-24 22:47:23 +00:00
plat-s5pc1xx ARM: SAMSUNG: Remove empty gpio-core.h and use central plat/gpio-core.h 2010-01-19 18:46:02 +09:00
plat-samsung 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
plat-stmp3xxx 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
tools ARM: Update mach-types 2010-03-20 15:37:39 +00:00
vfp Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
Kconfig ARM: Fix sorting of platform group config options and includes 2010-03-15 19:03:06 +00:00
Kconfig-nommu
Kconfig.debug ARM: SAMSUNG: Move plat-s3c Kconfig entries to plat-samsung and plat-s3c24xx 2010-02-24 01:52:06 +00:00
Makefile Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00