android_kernel_xiaomi_sm8350/drivers/scsi/bfa
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 [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
bfa_callback_priv.h
bfa_cb_ioim_macros.h
bfa_cee.c
bfa_core.c [SCSI] bfa: Added firmware save clear feature for BFA driver. 2010-03-07 12:58:59 +05:30
bfa_csdebug.c
bfa_fcpim_priv.h
bfa_fcpim.c
bfa_fcport.c [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
bfa_fcs_lport.c [SCSI] bfa: Replace bfa_get_attr() with specific APIs 2010-03-07 13:07:00 +05:30
bfa_fcs_port.c [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
bfa_fcs_uf.c [SCSI] bfa: New interface to handle firmware upgrade scenario 2010-03-04 16:14:10 +05:30
bfa_fcs.c [SCSI] bfa: New interface to handle firmware upgrade scenario 2010-03-04 16:14:10 +05:30
bfa_fcxp_priv.h
bfa_fcxp.c
bfa_fwimg_priv.h
bfa_hw_cb.c [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt. 2010-03-07 13:02:14 +05:30
bfa_hw_ct.c [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt. 2010-03-07 13:02:14 +05:30
bfa_intr_priv.h
bfa_intr.c [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt. 2010-03-07 13:02:14 +05:30
bfa_ioc_cb.c [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
bfa_ioc_ct.c [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
bfa_ioc.c [SCSI] bfa: Replace bfa_get_attr() with specific APIs 2010-03-07 13:07:00 +05:30
bfa_ioc.h [SCSI] bfa: Replace bfa_get_attr() with specific APIs 2010-03-07 13:07:00 +05:30
bfa_iocfc_q.c
bfa_iocfc.c [SCSI] bfa: IOC fixes, check for IOC down condition. 2010-03-07 13:03:50 +05:30
bfa_iocfc.h [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt. 2010-03-07 13:02:14 +05:30
bfa_ioim.c [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault() 2010-03-07 12:54:18 +05:30
bfa_itnim.c [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault() 2010-03-07 12:54:18 +05:30
bfa_log_module.c
bfa_log.c
bfa_lps_priv.h
bfa_lps.c [SCSI] bfa: Replace bfa_get_attr() with specific APIs 2010-03-07 13:07:00 +05:30
bfa_module.c [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
bfa_modules_priv.h [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
bfa_os_inc.h
bfa_port_priv.h [SCSI] bfa: Modified the portstats get/clear logic 2010-03-07 13:10:13 +05:30
bfa_port.c
bfa_priv.h [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
bfa_rport_priv.h
bfa_rport.c [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault() 2010-03-07 12:54:18 +05:30
bfa_sgpg_priv.h
bfa_sgpg.c
bfa_sm.c
bfa_timer.c
bfa_trcmod_priv.h [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
bfa_tskim.c [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault() 2010-03-07 12:54:18 +05:30
bfa_uf_priv.h
bfa_uf.c
bfad_attr.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
bfad_attr.h [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
bfad_drv.h [SCSI] bfa: Update the driver version to 2.1.2.1. 2010-03-07 13:28:38 +05:30
bfad_fwimg.c
bfad_im_compat.h
bfad_im.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
bfad_im.h [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
bfad_intr.c
bfad_ipfc.h
bfad_os.c
bfad_tm.h
bfad_trcmod.h
bfad.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
fab.c
fabric.c [SCSI] bfa: FCS and include file changes. 2010-03-07 13:12:04 +05:30
fcbuild.c
fcbuild.h [SCSI] bfa: FCS and include file changes. 2010-03-07 13:12:04 +05:30
fcpim.c [SCSI] bfa: Remove unused header files and did some cleanup. 2010-03-07 13:27:51 +05:30
fcptm.c
fcs_auth.h
fcs_fabric.h [SCSI] bfa: FCS authentication related changes. 2010-03-07 12:58:41 +05:30
fcs_fcpim.h [SCSI] bfa: New interface to handle firmware upgrade scenario 2010-03-04 16:14:10 +05:30
fcs_fcptm.h
fcs_fcxp.h
fcs_lport.h [SCSI] bfa: Resume BFA operations after firmware mismatch is resolved. 2010-03-04 16:17:02 +05:30
fcs_ms.h
fcs_port.h [SCSI] bfa: New interface to handle firmware upgrade scenario 2010-03-04 16:14:10 +05:30
fcs_rport.h [SCSI] bfa: New interface to handle firmware upgrade scenario 2010-03-04 16:14:10 +05:30
fcs_trcmod.h
fcs_uf.h [SCSI] bfa: New interface to handle firmware upgrade scenario 2010-03-04 16:14:10 +05:30
fcs_vport.h [SCSI] bfa: Fix to allow creation of only 190 vports on CNA. 2010-03-04 16:15:24 +05:30
fcs.h
fdmi.c [SCSI] bfa: FCS and include file changes. 2010-03-07 13:12:04 +05:30
loop.c [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
lport_api.c [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
lport_priv.h
Makefile [SCSI] bfa: IOC changes: Support faster recovery and split bfa_ioc.c into ASIC specific code. 2010-03-07 12:49:48 +05:30
ms.c [SCSI] bfa: FCS and include file changes. 2010-03-07 13:12:04 +05:30
n2n.c
ns.c [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
plog.c
rport_api.c [SCSI] bfa: Rename pport to fcport in BFA FCS. 2010-03-07 13:05:10 +05:30
rport_ftrs.c [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault() 2010-03-07 12:54:18 +05:30
rport.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
scn.c [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault() 2010-03-07 12:54:18 +05:30
vfapi.c
vport.c [SCSI] bfa: Replace bfa_get_attr() with specific APIs 2010-03-07 13:07:00 +05:30