2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00
linux-next/drivers/media/video/cx18
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
..
cx18-alsa-main.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
cx18-alsa-mixer.c V4L/DVB: cx18: Rename snd_cx18_mixer_lock to snd_cx18_lock and increase visibility 2010-02-26 15:10:50 -03:00
cx18-alsa-mixer.h V4L/DVB: cx18-alsa: Initial non-working cx18-alsa files 2010-02-26 15:10:42 -03:00
cx18-alsa-pcm.c V4L/DVB: drivers/media/video/cx18/cx18-alsa-pcm.c: fix printk warning 2010-02-26 15:10:51 -03:00
cx18-alsa-pcm.h V4L/DVB: cx18: overhaul ALSA PCM device handling so it works 2010-02-26 15:10:43 -03:00
cx18-alsa.h V4L/DVB: cx18: Rename snd_cx18_mixer_lock to snd_cx18_lock and increase visibility 2010-02-26 15:10:50 -03:00
cx18-audio.c V4L/DVB (11624): cx18: Toggle the AI1 mux when changing the CX18_AUDIO_ENABLE register 2009-06-16 18:20:45 -03:00
cx18-audio.h V4L/DVB (10758): cx18: Convert I2C devices to v4l2_subdevices 2009-03-30 12:43:01 -03:00
cx18-av-audio.c V4L/DVB (11310): cx18: remove intermediate 'ioctl' step 2009-03-30 12:43:49 -03:00
cx18-av-core.c V4L/DVB (13478): cx18: remove bogus init call. 2009-12-05 18:42:05 -02:00
cx18-av-core.h tree-wide: fix misspelling of "definition" in comments 2009-12-04 23:41:47 +01:00
cx18-av-firmware.c V4L/DVB (11624): cx18: Toggle the AI1 mux when changing the CX18_AUDIO_ENABLE register 2009-06-16 18:20:45 -03:00
cx18-av-vbi.c V4L/DVB (11864): cx18: Complete support for Sliced and Raw VBI for 625 line systems 2009-06-16 18:21:14 -03:00
cx18-cards.c V4L/DVB (13912): cx18: Fix tuner reset pin in card entry for the Leadtek PVR2100 2010-02-26 15:10:30 -03:00
cx18-cards.h V4L/DVB (13445): cx18: Use per cx18 instance init data for ir-kbd-i2c instead of const data 2009-12-05 18:41:57 -02:00
cx18-controls.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
cx18-controls.h V4L/DVB (8113): ivtv/cx18: remove s/g_ctrl, now all controls are handled through s/g_ext_ctrl 2008-07-20 07:12:23 -03:00
cx18-driver.c cx18: Fix compilation when CONFIG_MODULE is disabled 2010-02-26 15:10:48 -03:00
cx18-driver.h 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
cx18-dvb.c V4L/DVB: cx18: Add missing serialization locks to cx18-dvb 2010-02-26 15:10:50 -03:00
cx18-dvb.h V4L/DVB (9720): cx18: Major rewrite of interrupt handling for incoming mailbox processing 2008-12-30 09:38:07 -02:00
cx18-fileops.c V4L/DVB: cx18: export a couple of symbols so they can be shared with cx18-alsa 2010-02-26 15:10:42 -03:00
cx18-fileops.h V4L/DVB: cx18: export a couple of symbols so they can be shared with cx18-alsa 2010-02-26 15:10:42 -03:00
cx18-firmware.c V4L/DVB (10757): cx18, v4l2-chip-ident: Finish conversion of AV decoder core to v4l2_subdev 2009-03-30 12:43:01 -03:00
cx18-firmware.h
cx18-gpio.c V4L/DVB (11380): v4l2-subdev: change s_routing prototype 2009-04-06 21:44:27 -03:00
cx18-gpio.h V4L/DVB (10759): cx18: Convert GPIO connected functions to act as v4l2_subdevices 2009-03-30 12:43:01 -03:00
cx18-i2c.c V4L/DVB (13445): cx18: Use per cx18 instance init data for ir-kbd-i2c instead of const data 2009-12-05 18:41:57 -02:00
cx18-i2c.h V4L/DVB (10758): cx18: Convert I2C devices to v4l2_subdevices 2009-03-30 12:43:01 -03:00
cx18-io.c V4L/DVB (9727): cx18: Adjust outgoing mailbox timeouts and remove statistics logging 2008-12-30 09:38:11 -02:00
cx18-io.h V4L/DVB (9778): cx18: cx18_writel_expect() should not declare success on a PCI read error 2008-12-30 09:38:20 -02:00
cx18-ioctl.c V4L/DVB (13908): cx18: Add initial working VIDIOC_G_ENC_INDEX ioctl() support 2010-02-26 15:10:30 -03:00
cx18-ioctl.h V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
cx18-irq.c V4L/DVB (9728): cx18: Copyright attribution update for files modified by awalls 2008-12-30 09:38:11 -02:00
cx18-irq.h V4L/DVB (9728): cx18: Copyright attribution update for files modified by awalls 2008-12-30 09:38:11 -02:00
cx18-mailbox.c V4L/DVB: cx18: overhaul ALSA PCM device handling so it works 2010-02-26 15:10:43 -03:00
cx18-mailbox.h Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2009-12-09 19:50:49 -08:00
cx18-queue.c V4L/DVB (13904): cx18: Fix TS and IDX stream buffer memory leak on module unload 2010-02-26 15:10:29 -03:00
cx18-queue.h V4L/DVB (13433): cx18: Remove duplicate list traversal when processing incoming MDLs 2009-12-05 18:41:53 -02:00
cx18-scb.c V4L/DVB (9895): cx18: Refine the firmware load and firmware startup process 2008-12-30 09:39:09 -02:00
cx18-scb.h V4L/DVB (13426): cx18: Rename struct cx18_mdl to struct cx18_mdl_ent 2009-12-05 18:41:50 -02:00
cx18-streams.c V4L/DVB: cx18: export more symbols required by cx18-alsa 2010-02-26 15:10:43 -03:00
cx18-streams.h V4L/DVB (13907): cx18: Perform automatic rotation of very old, unread IDX buffers 2010-02-26 15:10:30 -03:00
cx18-vbi.c V4L/DVB (13429): cx18: Add Memory Descriptor List (MDL) layer to buffer handling 2009-12-05 18:41:51 -02:00
cx18-vbi.h V4L/DVB (13429): cx18: Add Memory Descriptor List (MDL) layer to buffer handling 2009-12-05 18:41:51 -02:00
cx18-version.h V4L/DVB: cx18: Increment driver version for the addition of cx18-alsa and fixes 2010-02-26 15:10:50 -03:00
cx18-video.c V4L/DVB (11380): v4l2-subdev: change s_routing prototype 2009-04-06 21:44:27 -03:00
cx18-video.h
cx23418.h V4L/DVB (13910): cx18: Fix set indextable command to properly select I/P/B index entries 2010-02-26 15:10:30 -03:00
Kconfig V4L/DVB: cx18: add cx18-alsa module to Makefile 2010-02-26 15:10:43 -03:00
Makefile V4L/DVB: cx18: add cx18-alsa module to Makefile 2010-02-26 15:10:43 -03:00