linux/arch/sparc/kernel
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
..
.gitignore sparc: gitignore a few files 2008-12-04 09:17:15 -08:00
apc.c sparc: Remove BKL from apc 2009-11-02 21:15:59 -08:00
asm-offsets.c sparc,sparc64: unify asm-offsets.c 2008-12-04 09:17:12 -08:00
audit.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
auxio_32.c No auxio on LEON 2009-11-16 02:54:07 -08:00
auxio_64.c sparc64: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:20 -08:00
btext.c sparc64: Faster early-boot framebuffer console. 2009-11-27 17:33:43 -08:00
central.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
cherrs.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
chmc.c sparc64: Fix crashes in jbusmc_print_dimm() 2009-02-11 00:54:07 -08:00
compat_audit.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
cpu.c sparc, leon: Added Aeroflex Gaisler entry in manufacturer_info structure 2009-12-02 22:28:49 -08:00
cpumap.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
cpumap.h sparc64: fix and optimize irq distribution 2009-06-16 04:56:28 -07:00
devices.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6 2010-03-02 07:56:44 -08:00
dma.c sparc: Add CONFIG_DMA_API_DEBUG support 2009-08-10 09:35:00 +02:00
ds.c sparc64: Defer cpu_data() setup until end of per-cpu data initialization. 2009-06-16 04:56:22 -07:00
dtlb_miss.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
dtlb_prot.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
ebus.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
entry.h sparc64: Kill off old sys_perfctr system call and state. 2010-03-03 08:08:49 -08:00
entry.S sparc64: Add syscall tracepoint support. 2009-12-11 00:44:47 -08:00
etrap_32.S sparc: prepare kernel/ for unification 2008-12-04 09:17:20 -08:00
etrap_64.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
fpu_traps.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
ftrace.c tracing: Unify arch_syscall_addr() implementations 2010-02-17 13:07:21 +01:00
getsetcc.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
head_32.S sparc,leon: Sparc-Leon SMP support 2009-11-02 04:19:42 -08:00
head_64.S sparc64: Store per-cpu offset in trap_block[] 2009-06-16 04:56:11 -07:00
helpers.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
hvapi.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
hvcalls.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
hvtramp.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
idprom.c sparc,leon: Introduce the sparc-leon CPU type. 2009-08-17 18:32:10 -07:00
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
iommu_common.h sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
iommu.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
ioport.c dma-mapping: sparc: unify 32bit and 64bit dma_set_mask 2010-03-12 15:52:42 -08:00
irq_32.c sparc,leon: Introduce the sparc-leon CPU type. 2009-08-17 18:32:10 -07:00
irq_64.c sparc64: Fix UP build. 2010-01-26 04:16:49 -08:00
irq.h sparc32: Kill clear_profile_irq btfixup entry. 2008-09-19 21:17:59 -07:00
itlb_miss.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
ivec.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
kernel.h sparc: Probe PMU type and record in sparc_pmu_type. 2009-01-28 17:27:14 -08:00
kgdb_32.c sparc: add '32' suffix to reg_window, sigcontext, __siginfo_t 2009-01-02 19:32:59 -08:00
kgdb_64.c sparc64: Reschedule KGDB capture to a software interrupt. 2009-03-18 23:51:57 -07:00
kprobes.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
kstack.h sparc64: Tighten checks in kstack_valid(). 2010-02-12 12:03:45 -08:00
ktlb.S sparc64: Increase vmalloc size to fix percpu regressions. 2009-09-28 14:39:58 -07:00
ldc.c sparc: use bitmap_find_next_zero_area 2009-12-16 07:20:19 -08:00
led.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
leon_kernel.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
leon_smp.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
Makefile sparc64: Faster early-boot framebuffer console. 2009-11-27 17:33:43 -08:00
mdesc.c sparc64: Use free_bootmem_late() in mdesc_lmb_free(). 2009-12-11 01:16:46 -08:00
misctrap.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
module.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
muldiv.c sparc: add '32' suffix to reg_window, sigcontext, __siginfo_t 2009-01-02 19:32:59 -08:00
nmi.c Merge branch 'master' into percpu 2010-02-02 14:38:15 +09:00
of_device_32.c Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-02-25 15:38:37 -08:00
of_device_64.c Merge commit 'v2.6.33-rc5' into secretlab/test-devicetree 2010-01-28 14:38:25 -07:00
of_device_common.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
of_device_common.h sparc: move of_device common code to of_device_common 2009-06-16 04:56:49 -07:00
pci_common.c sparc64: Fix crash with /proc/iomem 2009-03-18 23:53:16 -07:00
pci_fire.c sparc64: Fix section mismatch warnings in PCI controller drivers. 2009-04-08 03:28:15 -07:00
pci_impl.h sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
pci_msi.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
pci_psycho.c sparc64: Fix section mismatch warnings in PCI controller drivers. 2009-04-08 03:28:15 -07:00
pci_sabre.c sparc64: Fix section mismatch warnings in PCI controller drivers. 2009-04-08 03:28:15 -07:00
pci_schizo.c sparc64: Use unsigned long long for u64. 2009-01-06 13:19:28 -08:00
pci_sun4v_asm.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
pci_sun4v.c sparc: Remove no-op dma_4v_sync_single_for_cpu and dma_4v_sync_sg_for_cpu 2009-08-10 09:34:59 +02:00
pci_sun4v.h sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
pci.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6 2010-03-02 07:56:44 -08:00
pcic.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6 2010-03-02 07:56:44 -08:00
pcr.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
perf_event.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2010-03-29 14:41:00 -07:00
pmc.c sparc: fix trivial style issues in kernel/pmc.c 2008-12-08 01:02:55 -08:00
power.c sparc64: Fix section mismatch warnings in power driver. 2009-04-08 03:27:52 -07:00
process_32.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
process_64.c sparc64: Kill off old sys_perfctr system call and state. 2010-03-03 08:08:49 -08:00
prom_32.c sparc,leon: Added support for AMBAPP bus. 2009-08-17 18:32:10 -07:00
prom_64.c sparc64: Defer cpu_data() setup until end of per-cpu data initialization. 2009-06-16 04:56:22 -07:00
prom_common.c of: merge of_find_node_by_phandle 2010-02-09 08:32:48 -07:00
prom_irqtrans.c sparc64: Use unsigned long long for u64. 2009-01-06 13:19:28 -08:00
prom.h of/sparc: Remove sparc-local declaration of allnodes and devtree_lock 2010-02-14 13:02:44 -07:00
psycho_common.c sparc64: fix warnings in psycho_common after ull conversion 2009-01-08 11:37:19 -08:00
psycho_common.h sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
ptrace_32.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
ptrace_64.c sparc64: Add syscall tracepoint support. 2009-12-11 00:44:47 -08:00
reboot.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
rtrap_32.S sparc: prepare kernel/ for unification 2008-12-04 09:17:20 -08:00
rtrap_64.S Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2010-03-04 08:24:47 -08:00
sbus.c sparc64: move EXPORT_SYMBOL to the symbols definition 2009-01-08 16:58:20 -08:00
setup_32.c sparc: remove redundant return statements 2010-02-10 11:47:57 -08:00
setup_64.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
signal32.c sparc: Align clone and signal stacks to 16 bytes. 2010-02-09 16:18:40 -08:00
signal_32.c sparc: Align clone and signal stacks to 16 bytes. 2010-02-09 16:18:40 -08:00
signal_64.c sparc: Align clone and signal stacks to 16 bytes. 2010-02-09 16:18:40 -08:00
smp_32.c sparc,leon: Sparc-Leon SMP support 2009-11-02 04:19:42 -08:00
smp_64.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
sparc_ksyms_32.c sparc: Eliminate PROMLIB_INTERNAL as it does nothing 2009-01-08 16:59:01 -08:00
sparc_ksyms_64.c sparc64: don't export static inline pci_ functions 2009-12-15 16:28:13 +10:30
spiterrs.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
sstate.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
stacktrace.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
starfire.c sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
sun4c_irq.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
sun4d_irq.c cpumask: remove references to struct irqaction's mask field. 2009-03-30 22:05:14 +10:30
sun4d_smp.c sparc: remove trailing space in messages 2010-02-12 12:08:51 -08:00
sun4m_irq.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
sun4m_smp.c sparc32: Kill trap table freeing code. 2009-08-18 23:44:08 -07:00
sun4v_ivec.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
sun4v_tlb_miss.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
sys32.S sparc64: Kill off old sys_perfctr system call and state. 2010-03-03 08:08:49 -08:00
sys_sparc32.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
sys_sparc_32.c Add generic sys_ipc wrapper 2010-03-12 15:52:32 -08:00
sys_sparc_64.c improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
syscalls.S sparc64: Kill off old sys_perfctr system call and state. 2010-03-03 08:08:49 -08:00
sysfs.c arch/sparc/kernel: Use set_cpus_allowed_ptr 2010-03-27 21:11:56 -07:00
systbls_32.S sparc_brk() is not needed anymore 2009-12-11 06:44:58 -05:00
systbls_64.S improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
systbls.h improve sys_newuname() for compat architectures 2010-03-12 15:52:32 -08:00
tadpole.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tick14.c sparc32: Delete claim_ticker14(). 2008-09-19 21:18:01 -07:00
time_32.c sparc: convert to arch_gettimeoffset() 2010-01-15 01:34:28 -08:00
time_64.c sparc64: Fix clock event multiplier printf format. 2009-12-11 02:05:05 -08:00
trampoline_32.S sparc,leon: Sparc-Leon SMP support 2009-11-02 04:19:42 -08:00
trampoline_64.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
traps_32.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
traps_64.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
tsb.S sparc64: Fix sun4u execute bit check in TSB I-TLB load. 2010-02-19 15:19:52 -08:00
ttable.S sparc64: Reschedule KGDB capture to a software interrupt. 2009-03-18 23:51:57 -07:00
una_asm_32.S sparc: prepare kernel/ for unification 2008-12-04 09:17:20 -08:00
una_asm_64.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
unaligned_32.c sparc: Add alignment and emulation fault perf events. 2009-12-11 01:07:53 -08:00
unaligned_64.c sparc: use __ratelimit 2010-02-28 03:31:29 -08:00
us2e_cpufreq.c arch/sparc/kernel: Use set_cpus_allowed_ptr 2010-03-27 21:11:56 -07:00
us3_cpufreq.c arch/sparc/kernel: Use set_cpus_allowed_ptr 2010-03-27 21:11:56 -07:00
utrap.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
vio.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
viohs.c sparc64: refactor code in viohs.c 2009-01-06 12:46:46 -08:00
visemul.c sparc: Add alignment and emulation fault perf events. 2009-12-11 01:07:53 -08:00
vmlinux.lds.S sparc: Clean up linker script using new linker script macros. 2009-09-18 13:57:18 -07:00
windows.c sparc: add '32' suffix to reg_window, sigcontext, __siginfo_t 2009-01-02 19:32:59 -08:00
winfixup.S sparc,sparc64: unify kernel/ 2008-12-04 09:17:21 -08:00
wof.S sparc/kernel/: possible cleanups 2008-07-17 21:37:46 -07:00
wuf.S sparc/kernel/: possible cleanups 2008-07-17 21:37:46 -07:00