android_kernel_xiaomi_sm8350/drivers/gpu/drm/nouveau
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
..
Kconfig
Makefile drm/nv50: Implement ctxprog/state generation. 2010-02-25 15:09:38 +10:00
nouveau_acpi.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
nouveau_backlight.c backlight: Allow properties to be passed at registration 2010-03-16 19:47:54 +00:00
nouveau_bios.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
nouveau_bios.h drm/nouveau: check for known dcb connector types 2010-02-25 15:09:28 +10:00
nouveau_bo.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
nouveau_calc.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nouveau_channel.c drm/nouveau: new gem pushbuf interface, bump to 0.0.16 2010-02-25 15:08:44 +10:00
nouveau_connector.c drm/nouveau: report unknown connector state if lid closed 2010-02-25 15:09:44 +10:00
nouveau_connector.h drm/nouveau: use dcb connector table for creating drm connectors 2010-02-25 15:09:32 +10:00
nouveau_crtc.h
nouveau_debugfs.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nouveau_display.c Use drm_gem_object_[handle_]unreference_unlocked where possible 2010-02-11 14:22:34 +10:00
nouveau_dma.c drm/nouveau: new gem pushbuf interface, bump to 0.0.16 2010-02-25 15:08:44 +10:00
nouveau_dma.h drm/nouveau: new gem pushbuf interface, bump to 0.0.16 2010-02-25 15:08:44 +10:00
nouveau_dp.c drm/nouveau: make dp auxch xfer len check for reads only 2010-02-09 12:50:43 +10:00
nouveau_drv.c Merge branch 'gpu-switcher' of /ssd/git//linux-2.6 into drm-next-stage 2010-03-01 16:22:38 +10:00
nouveau_drv.h Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
nouveau_encoder.h
nouveau_fb.h
nouveau_fbcon.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
nouveau_fbcon.h drm/nouveau: Fix fbcon on mixed pre-NV50 + NV50 multicard. 2010-02-09 12:50:14 +10:00
nouveau_fence.c
nouveau_gem.c Merge remote branch 'nouveau/for-airlied' into drm-next-stage 2010-03-01 15:41:15 +10:00
nouveau_grctx.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
nouveau_grctx.h
nouveau_hw.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nouveau_hw.h
nouveau_i2c.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nouveau_i2c.h
nouveau_ioc32.c
nouveau_irq.c drm/nouveau: protect channel create/destroy and irq handler with a spinlock 2010-02-25 15:07:53 +10:00
nouveau_mem.c drm/nv50: fix vram ptes on IGPs to point at stolen system memory 2010-02-23 13:50:24 +10:00
nouveau_notifier.c Use drm_gem_object_[handle_]unreference_unlocked where possible 2010-02-11 14:22:34 +10:00
nouveau_object.c drm/nouveau: move dereferences after null checks 2010-02-11 09:52:00 +10:00
nouveau_reg.h
nouveau_sgdma.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
nouveau_state.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
nouveau_ttm.c
nv04_crtc.c Use drm_gem_object_[handle_]unreference_unlocked where possible 2010-02-11 14:22:34 +10:00
nv04_cursor.c
nv04_dac.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nv04_dfp.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nv04_display.c drm/nouveau: use dcb connector table for creating drm connectors 2010-02-25 15:09:32 +10:00
nv04_fb.c
nv04_fbcon.c drm/nouveau: use ALIGN instead of open coding it 2010-02-25 15:09:46 +10:00
nv04_fifo.c drm/nouveau: protect channel create/destroy and irq handler with a spinlock 2010-02-25 15:07:53 +10:00
nv04_graph.c
nv04_instmem.c
nv04_mc.c
nv04_timer.c
nv04_tv.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nv10_fb.c
nv10_fifo.c
nv10_graph.c
nv17_gpio.c
nv17_tv_modes.c
nv17_tv.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nv17_tv.h
nv20_graph.c
nv40_fb.c
nv40_fifo.c drm/nouveau: protect channel create/destroy and irq handler with a spinlock 2010-02-25 15:07:53 +10:00
nv40_graph.c
nv40_grctx.c
nv40_mc.c
nv50_crtc.c Use drm_gem_object_[handle_]unreference_unlocked where possible 2010-02-11 14:22:34 +10:00
nv50_cursor.c
nv50_dac.c drm/nouveau: merge nvbios and nouveau_bios_info 2010-02-25 15:09:21 +10:00
nv50_display.c drm/nv50: enable hpd on any connector we know the gpio line for 2010-02-25 15:09:34 +10:00
nv50_display.h
nv50_evo.h
nv50_fbcon.c drm/nouveau: use ALIGN instead of open coding it 2010-02-25 15:09:46 +10:00
nv50_fifo.c drm/nv50: switch to indirect push buffer controls 2010-02-25 15:08:29 +10:00
nv50_graph.c drm/nv50: Implement ctxprog/state generation. 2010-02-25 15:09:38 +10:00
nv50_grctx.c drm/nv50: Implement ctxprog/state generation. 2010-02-25 15:09:38 +10:00
nv50_instmem.c drm/nouveau: use ALIGN instead of open coding it 2010-02-25 15:09:46 +10:00
nv50_mc.c
nv50_sor.c drm/nv50: disregard dac outputs in nv50_sor_dpms() 2010-02-10 08:19:33 +10:00
nvreg.h