dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/arch/arm/mach-orion5x
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
..
include/mach Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
Kconfig [ARM] Orion: Add Buffalo Linkstation LS-HGL support 2010-02-05 00:27:06 -05:00
Makefile [ARM] Orion: Add Buffalo Linkstation LS-HGL support 2010-02-05 00:27:06 -05:00
Makefile.boot Orion: orion -> orion5x rename 2008-03-27 14:51:41 -04:00
addr-map.c ¶ARM] Orion5x: fix cpu window mapping for 88f6183 2009-08-10 18:03:59 -04:00
common.c mach-orion5x/common.c: remove unnecessary (void *) casts 2010-02-04 21:10:54 -05:00
common.h [ARM] orion5x: register the crypto device on SOCs that support it 2009-06-15 00:37:08 -04:00
d2net-setup.c [ARM] Orion5x: enable SATA LED blinking for d2net 2010-02-09 20:49:01 -05:00
db88f5281-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
dns323-setup.c [ARM] orion5x: D-link DNS-323 revision A1 power LED 2010-02-10 11:31:30 -05:00
edmini_v2-setup.c [ARM] EDMINIV2: add support for LED and power button 2008-09-25 16:27:22 -04:00
irq.c [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
kurobox_pro-setup.c Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
ls_hgl-setup.c [ARM] orion5x: fix some improper includes in Linkstation files 2010-02-05 00:27:07 -05:00
lsmini-setup.c [ARM] orion5x: fix some improper includes in Linkstation files 2010-02-05 00:27:07 -05:00
mpp.c [ARM] orion: convert gpio to use gpiolib 2009-06-08 13:04:57 -04:00
mpp.h [ARM] Orion: rework MPP handling 2008-06-22 22:44:47 +02:00
mss2-setup.c [ARM] orion5x: Change names of defines for Reset-Out-Mask register 2009-06-08 13:04:59 -04:00
mv2120-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
net2big-setup.c [ARM] orion5x: Add LaCie NAS 2Big Network support 2009-09-08 14:10:35 -04:00
pci.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
rd88f5181l-fxo-setup.c dsa: add switch chip cascading support 2009-03-21 19:06:54 -07:00
rd88f5181l-ge-setup.c dsa: add switch chip cascading support 2009-03-21 19:06:54 -07:00
rd88f5182-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
rd88f6183ap-ge-setup.c dsa: add switch chip cascading support 2009-03-21 19:06:54 -07:00
terastation_pro2-setup.c [ARM] Orion: add Buffalo Terastation Pro II/Live support 2008-09-25 16:26:44 -04:00
ts78xx-fpga.h [ARM] orion: add hwrng timeriomem hook to TS-78xx 2009-06-03 15:29:40 -04:00
ts78xx-setup.c [ARM] orion: add hwrng timeriomem hook to TS-78xx 2009-06-03 15:29:40 -04:00
ts209-setup.c [ARM] Orion: register UART1 on QNAP TS-209 and TS-409 2008-08-21 22:15:17 -04:00
ts409-setup.c [ARM] Orion: register UART1 on QNAP TS-209 and TS-409 2008-08-21 22:15:17 -04:00
tsx09-common.c Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
tsx09-common.h [ARM] Orion: remove code duplication in TS209 and TS409 setup files 2008-06-22 22:44:54 +02:00
wnr854t-setup.c [ARM] orion5x: WNR854T switch support 2009-06-08 13:05:00 -04:00
wrt350n-v2-setup.c [ARM] Orion5x: replace KEY_WLAN with KEY_WPS_BUTTON 2010-03-23 13:48:15 -04:00