]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Reapply, with minor tweaks, r338025, from the original commit:
authorimp <imp@FreeBSD.org>
Wed, 26 Sep 2018 17:12:14 +0000 (17:12 +0000)
committerimp <imp@FreeBSD.org>
Wed, 26 Sep 2018 17:12:14 +0000 (17:12 +0000)
commit8efc2b3f05053bd7c6d2c0b6e0fbde9ffc58bbe5
treeef997f398912dc47f9b0b15d284552e6c6bdc0cc
parent07abcaa5746727a0f55b37a06b7b21b2458d092b
Reapply, with minor tweaks, r338025, from the original commit:

Remove unused and easy to misuse PNP macro parameter

Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely.  The 'table' parameter is now required to
have correct pointer (or array) type.  Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.

Mostly done with the coccinelle 'spatch' tool:

  $ cat modpnpsize0.cocci
    @normaltables@
    identifier b,c;
    expression a,d,e;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,d,
    -sizeof(d[0]),
     e);

    @singletons@
    identifier b,c,d;
    expression a;
    declarer MODULE_PNP_INFO;
    @@
     MODULE_PNP_INFO(a,b,c,&d,
    -sizeof(d),
     1);

  $ rg -l MODULE_PNP_INFO -- sys | \
    xargs spatch --in-place --sp-file modpnpsize0.cocci

(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not.  So I had to link gdiff into
PATH as diff to use spatch.)

Tinderbox'd (-DMAKE_JUST_KERNELS).
Approved by: re (glen)
46 files changed:
sys/crypto/ccp/ccp.c
sys/dev/aac/aac_pci.c
sys/dev/aacraid/aacraid_pci.c
sys/dev/adlink/adlink.c
sys/dev/ae/if_ae.c
sys/dev/age/if_age.c
sys/dev/ahci/ahci_pci.c
sys/dev/alc/if_alc.c
sys/dev/ale/if_ale.c
sys/dev/amdsmn/amdsmn.c
sys/dev/amdtemp/amdtemp.c
sys/dev/amr/amr_pci.c
sys/dev/an/if_an_pci.c
sys/dev/bce/if_bce.c
sys/dev/bfe/if_bfe.c
sys/dev/bge/if_bge.c
sys/dev/bwi/if_bwi_pci.c
sys/dev/bwn/if_bwn_pci.c
sys/dev/cas/if_cas.c
sys/dev/ciss/ciss.c
sys/dev/dc/if_dc.c
sys/dev/drm2/i915/i915_drv.c
sys/dev/drm2/radeon/radeon_drv.c
sys/dev/ed/if_ed_pci.c
sys/dev/ena/ena.c
sys/dev/et/if_et.c
sys/dev/fxp/if_fxp.c
sys/dev/gem/if_gem_pci.c
sys/dev/intpm/intpm.c
sys/dev/ioat/ioat.c
sys/dev/ipw/if_ipw.c
sys/dev/ixgbe/if_ix.c
sys/dev/ixgbe/if_ixv.c
sys/dev/ncr/ncr.c
sys/dev/ntb/ntb_hw/ntb_hw_intel.c
sys/dev/ofw/ofw_bus_subr.h
sys/dev/pccard/pccardvar.h
sys/dev/pci/pcivar.h
sys/dev/puc/puc_pci.c
sys/dev/spibus/spi.h
sys/dev/uart/uart_bus_pccard.c
sys/dev/usb/usbdi.h
sys/dev/xl/if_xl.c
sys/isa/isavar.h
sys/net/iflib.h
sys/sys/module.h