kernel-fxtec-pro1x/drivers/media/video/gspca
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
..
gl860 V4L/DVB (13898): gspca - some subdrivers: Make sd_desc const. 2010-02-26 15:10:29 -03:00
m5602 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
stv06xx V4L/DVB: gspca_stv06xx: Add support for camera button 2010-02-26 15:11:10 -03:00
benq.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
coarse_expo_autogain.h V4L/DVB: gscpa_sonixb: Differentiate between sensors with a coarse and fine expo ctrl 2010-02-26 15:11:08 -03:00
conex.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
cpia1.c V4L/DVB (14003): gspca_cpai1: New gspca subdriver for CPIA CPiA version 1 cams 2010-02-26 15:10:40 -03:00
etoms.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
finepix.c V4L/DVB (13453): gspca - all subdrivers: Remove the unused frame ptr from pkt_scan(). 2009-12-05 18:41:59 -02:00
gspca.c V4L/DVB: gspca_main: Fix a compile error when CONFIG_INPUT is not set 2010-02-26 15:11:10 -03:00
gspca.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
jeilinj.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
jpeg.h V4L/DVB (11039): gspca - most jpeg subdrivers: Change the JPEG header creation. 2009-03-30 12:43:22 -03:00
Kconfig V4L/DVB (14003): gspca_cpai1: New gspca subdriver for CPIA CPiA version 1 cams 2010-02-26 15:10:40 -03:00
Makefile V4L/DVB (14003): gspca_cpai1: New gspca subdriver for CPIA CPiA version 1 cams 2010-02-26 15:10:40 -03:00
mars.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
mr97310a.c V4L/DVB: gspca_mr97310a: add support for the Sakar 1638x CyberPix 2010-02-26 15:11:09 -03:00
ov519.c Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
ov534.c V4L/DVB: gspca - ov534: Fix end of frame handling 2010-02-26 15:10:47 -03:00
ov534_9.c V4L/DVB: gspca - ov534_9: Propagate USB errors to higher level 2010-02-26 15:10:47 -03:00
pac207.c V4L/DVB: gscpa_pac207: Add support for camera button 2010-02-26 15:11:07 -03:00
pac7302.c V4L/DVB: gspca_pac7302: much improved exposure control 2010-02-26 15:11:09 -03:00
pac7311.c V4L/DVB: gscpa_pac7311: Add support for camera button 2010-02-26 15:11:08 -03:00
pac_common.h V4L/DVB: gspca_pac7302: much improved exposure control 2010-02-26 15:11:09 -03:00
sn9c20x.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
sn9c2028.c V4L/DVB (13992): gspca_sn9c2028: New gspca subdriver 2010-02-26 15:10:39 -03:00
sn9c2028.h V4L/DVB (13992): gspca_sn9c2028: New gspca subdriver 2010-02-26 15:10:39 -03:00
sonixb.c V4L/DVB: gspca_sonixb: Make sonixb driver handle pas106 and pas202 cameras 2010-02-26 15:11:09 -03:00
sonixj.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
spca500.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
spca501.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
spca505.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
spca506.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
spca508.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
spca561.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
sq905.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
sq905c.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
stk014.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
stv0680.c V4L/DVB (13996): gspca_stv0680: Fix streaming on vga cameras 2010-02-26 15:10:39 -03:00
sunplus.c V4L/DVB (13924): gspca - sunplus: Optimize and remove unused sequences. 2010-02-26 15:10:31 -03:00
t613.c V4L/DVB: gspca - t613: Support for LT168G sensor. 2010-02-26 15:10:49 -03:00
tv8532.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
vc032x.c V4L/DVB (13899): gspca - all subdrivers: Make control descriptors constant. 2010-02-26 15:10:29 -03:00
w996Xcf.c V4L/DVB (13453): gspca - all subdrivers: Remove the unused frame ptr from pkt_scan(). 2009-12-05 18:41:59 -02:00
zc3xx-reg.h V4L/DVB (9868): gspca - zc3xx: Remove the duplicated register names 2008-12-30 09:38:58 -02:00
zc3xx.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