Skip to content

Commit

Permalink
Reapply, with minor tweaks, r338025, from the original commit:
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
bsdimp committed Sep 26, 2018
1 parent 07abcaa commit 8efc2b3
Show file tree
Hide file tree
Showing 46 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion sys/crypto/ccp/ccp.c
Expand Up @@ -735,7 +735,7 @@ MODULE_VERSION(ccp, 1);
MODULE_DEPEND(ccp, crypto, 1, 1, 1);
MODULE_DEPEND(ccp, random_device, 1, 1, 1);
#if 0 /* There are enough known issues that we shouldn't load automatically */
MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, sizeof(ccp_ids[0]),
MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids,
nitems(ccp_ids));
#endif

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/aac/aac_pci.c
Expand Up @@ -494,7 +494,7 @@ static driver_t aacch_driver = {
static devclass_t aacch_devclass;
DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL);
MODULE_PNP_INFO("U16:vendor;U16:device;", pci, aac,
aac_identifiers, sizeof(aac_identifiers[0]), nitems(aac_identifiers) - 1);
aac_identifiers, nitems(aac_identifiers) - 1);

static int
aacch_probe(device_t dev)
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/aacraid/aacraid_pci.c
Expand Up @@ -106,7 +106,7 @@ struct aac_ident

DRIVER_MODULE(aacraid, pci, aacraid_pci_driver, aacraid_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, aacraid,
aacraid_family_identifiers, sizeof(aacraid_family_identifiers[0]),
aacraid_family_identifiers,
nitems(aacraid_family_identifiers) - 1);
MODULE_DEPEND(aacraid, pci, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/adlink/adlink.c
Expand Up @@ -438,6 +438,6 @@ static driver_t adlink_driver = {
};

DRIVER_MODULE(adlink, pci, adlink_driver, adlink_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id, sizeof(adlink_id[0]),
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, adlink, adlink_id,
nitems(adlink_id));
#endif /* _KERNEL */
2 changes: 1 addition & 1 deletion sys/dev/ae/if_ae.c
Expand Up @@ -178,7 +178,7 @@ static devclass_t ae_devclass;

DRIVER_MODULE(ae, pci, ae_driver, ae_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ae, ae_devs,
sizeof(ae_devs[0]), nitems(ae_devs));
nitems(ae_devs));
DRIVER_MODULE(miibus, ae, miibus_driver, miibus_devclass, 0, 0);
MODULE_DEPEND(ae, pci, 1, 1, 1);
MODULE_DEPEND(ae, ether, 1, 1, 1);
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/age/if_age.c
Expand Up @@ -184,7 +184,7 @@ static devclass_t age_devclass;

DRIVER_MODULE(age, pci, age_driver, age_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, age, age_devs,
sizeof(age_devs[0]), nitems(age_devs));
nitems(age_devs));
DRIVER_MODULE(miibus, age, miibus_driver, miibus_devclass, 0, 0);

static struct resource_spec age_res_spec_mem[] = {
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ahci/ahci_pci.c
Expand Up @@ -667,7 +667,7 @@ static driver_t ahci_driver = {
DRIVER_MODULE(ahci, pci, ahci_driver, ahci_devclass, NULL, NULL);
/* Also matches class / subclass / progid XXX need to add when we have masking support */
MODULE_PNP_INFO("W32:vendor/device", pci, ahci, ahci_ids,
sizeof(ahci_ids[0]), nitems(ahci_ids) - 1);
nitems(ahci_ids) - 1);
static device_method_t ahci_ata_methods[] = {
DEVMETHOD(device_probe, ahci_ata_probe),
DEVMETHOD(device_attach, ahci_pci_attach),
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/alc/if_alc.c
Expand Up @@ -244,7 +244,7 @@ static devclass_t alc_devclass;

DRIVER_MODULE(alc, pci, alc_driver, alc_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, alc, alc_ident_table,
sizeof(alc_ident_table[0]), nitems(alc_ident_table) - 1);
nitems(alc_ident_table) - 1);
DRIVER_MODULE(miibus, alc, miibus_driver, miibus_devclass, 0, 0);

static struct resource_spec alc_res_spec_mem[] = {
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ale/if_ale.c
Expand Up @@ -179,7 +179,7 @@ static devclass_t ale_devclass;

DRIVER_MODULE(ale, pci, ale_driver, ale_devclass, NULL, NULL);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ale, ale_devs,
sizeof(ale_devs[0]), nitems(ale_devs));
nitems(ale_devs));
DRIVER_MODULE(miibus, ale, miibus_driver, miibus_devclass, NULL, NULL);

static struct resource_spec ale_res_spec_mem[] = {
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/amdsmn/amdsmn.c
Expand Up @@ -90,7 +90,7 @@ static devclass_t amdsmn_devclass;
DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL);
MODULE_VERSION(amdsmn, 1);
MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids,
sizeof(amdsmn_ids[0]), nitems(amdsmn_ids));
nitems(amdsmn_ids));

static bool
amdsmn_match(device_t parent)
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/amdtemp/amdtemp.c
Expand Up @@ -167,7 +167,7 @@ DRIVER_MODULE(amdtemp, hostb, amdtemp_driver, amdtemp_devclass, NULL, NULL);
MODULE_VERSION(amdtemp, 1);
MODULE_DEPEND(amdtemp, amdsmn, 1, 1, 1);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdtemp, amdtemp_products,
sizeof(amdtemp_products[0]), nitems(amdtemp_products));
nitems(amdtemp_products));

static int
amdtemp_match(device_t dev)
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/amr/amr_pci.c
Expand Up @@ -142,7 +142,7 @@ static struct amr_ident
static devclass_t amr_devclass;
DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, amr, amr_device_ids,
sizeof(amr_device_ids[0]), nitems(amr_device_ids) - 1);
nitems(amr_device_ids) - 1);
MODULE_DEPEND(amr, pci, 1, 1, 1);
MODULE_DEPEND(amr, cam, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/an/if_an_pci.c
Expand Up @@ -274,6 +274,6 @@ static devclass_t an_devclass;

DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an,
an_devs, sizeof(an_devs[0]), nitems(an_devs) - 1);
an_devs, nitems(an_devs) - 1);
MODULE_DEPEND(an, pci, 1, 1, 1);
MODULE_DEPEND(an, wlan, 1, 1, 1);
2 changes: 1 addition & 1 deletion sys/dev/bce/if_bce.c
Expand Up @@ -530,7 +530,7 @@ MODULE_DEPEND(bce, miibus, 1, 1, 1);
DRIVER_MODULE(bce, pci, bce_driver, bce_devclass, NULL, NULL);
DRIVER_MODULE(miibus, bce, miibus_driver, miibus_devclass, NULL, NULL);
MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, bce,
bce_devs, sizeof(bce_devs[0]), nitems(bce_devs) - 1);
bce_devs, nitems(bce_devs) - 1);

/****************************************************************************/
/* Tunable device values */
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/bfe/if_bfe.c
Expand Up @@ -158,7 +158,7 @@ static devclass_t bfe_devclass;

DRIVER_MODULE(bfe, pci, bfe_driver, bfe_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bfe, bfe_devs,
sizeof(bfe_devs[0]), nitems(bfe_devs) - 1);
nitems(bfe_devs) - 1);
DRIVER_MODULE(miibus, bfe, miibus_driver, miibus_devclass, 0, 0);

/*
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/bge/if_bge.c
Expand Up @@ -548,7 +548,7 @@ static devclass_t bge_devclass;

DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, bge, bge_devs,
sizeof(bge_devs[0]), nitems(bge_devs) - 1);
nitems(bge_devs) - 1);
DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0);

static int bge_allow_asf = 1;
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/bwi/if_bwi_pci.c
Expand Up @@ -257,7 +257,7 @@ static driver_t bwi_driver = {
static devclass_t bwi_devclass;
DRIVER_MODULE(bwi, pci, bwi_driver, bwi_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwi, bwi_devices,
sizeof(bwi_devices[0]), nitems(bwi_devices) - 1);
nitems(bwi_devices) - 1);
MODULE_DEPEND(bwi, wlan, 1, 1, 1); /* 802.11 media layer */
MODULE_DEPEND(bwi, firmware, 1, 1, 1); /* firmware support */
MODULE_DEPEND(bwi, wlan_amrr, 1, 1, 1);
4 changes: 2 additions & 2 deletions sys/dev/bwn/if_bwn_pci.c
Expand Up @@ -296,9 +296,9 @@ DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_methods,
DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, NULL,
NULL, SI_ORDER_ANY);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_siba,
siba_devices, sizeof(siba_devices[0]), nitems(siba_devices) - 1);
siba_devices, nitems(siba_devices) - 1);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, bwn_bcma,
bcma_devices, sizeof(bcma_devices[0]), nitems(bcma_devices) - 1);
bcma_devices, nitems(bcma_devices) - 1);
DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL);

MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1);
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/cas/if_cas.c
Expand Up @@ -2617,7 +2617,7 @@ static const struct cas_pci_dev {

DRIVER_MODULE(cas, pci, cas_pci_driver, cas_devclass, 0, 0);
MODULE_PNP_INFO("W32:vendor/device", pci, cas, cas_pci_devlist,
sizeof(cas_pci_devlist[0]), nitems(cas_pci_devlist) - 1);
nitems(cas_pci_devlist) - 1);
DRIVER_MODULE(miibus, cas, miibus_driver, miibus_devclass, 0, 0);
MODULE_DEPEND(cas, pci, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ciss/ciss.c
Expand Up @@ -365,7 +365,7 @@ static struct
static devclass_t ciss_devclass;
DRIVER_MODULE(ciss, pci, ciss_pci_driver, ciss_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;", pci, ciss, ciss_vendor_data,
sizeof(ciss_vendor_data[0]), nitems(ciss_vendor_data) - 1);
nitems(ciss_vendor_data) - 1);
MODULE_DEPEND(ciss, cam, 1, 1, 1);
MODULE_DEPEND(ciss, pci, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/dc/if_dc.c
Expand Up @@ -360,7 +360,7 @@ static devclass_t dc_devclass;
DRIVER_MODULE_ORDERED(dc, pci, dc_driver, dc_devclass, NULL, NULL,
SI_ORDER_ANY);
MODULE_PNP_INFO("W32:vendor/device;U8:revision;D:#", pci, dc, dc_devs,
sizeof(dc_devs[0]), nitems(dc_devs) - 1);
nitems(dc_devs) - 1);
DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, NULL, NULL);

#define DC_SETBIT(sc, reg, x) \
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/drm2/i915/i915_drv.c
Expand Up @@ -1237,7 +1237,7 @@ MODULE_DEPEND(i915kms, iicbus, 1, 1, 1);
MODULE_DEPEND(i915kms, iic, 1, 1, 1);
MODULE_DEPEND(i915kms, iicbb, 1, 1, 1);
MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist,
sizeof(pciidlist[0]), nitems(pciidlist) - 1);
nitems(pciidlist) - 1);

/* We give fast paths for the really cool registers */
#define NEEDS_FORCE_WAKE(dev_priv, reg) \
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/drm2/radeon/radeon_drv.c
Expand Up @@ -402,4 +402,4 @@ MODULE_DEPEND(radeonkms, iic, 1, 1, 1);
MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1);
MODULE_DEPEND(radeonkms, firmware, 1, 1, 1);
MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, radeonkms,
pciidlist, sizeof(pciidlist[0]), nitems(pciidlist) - 1);
pciidlist, nitems(pciidlist) - 1);
2 changes: 1 addition & 1 deletion sys/dev/ed/if_ed_pci.c
Expand Up @@ -145,5 +145,5 @@ static driver_t ed_pci_driver = {
DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0);
MODULE_DEPEND(ed, pci, 1, 1, 1);
MODULE_DEPEND(ed, ether, 1, 1, 1);
MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, sizeof(pci_ids[0]),
MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids,
nitems(pci_ids) - 1);
2 changes: 1 addition & 1 deletion sys/dev/ena/ena.c
Expand Up @@ -3948,7 +3948,7 @@ static driver_t ena_driver = {
devclass_t ena_devclass;
DRIVER_MODULE(ena, pci, ena_driver, ena_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, ena, ena_vendor_info_array,
sizeof(ena_vendor_info_array[0]), nitems(ena_vendor_info_array) - 1);
nitems(ena_vendor_info_array) - 1);
MODULE_DEPEND(ena, pci, 1, 1, 1);
MODULE_DEPEND(ena, ether, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/et/if_et.c
Expand Up @@ -189,7 +189,7 @@ static devclass_t et_devclass;

DRIVER_MODULE(et, pci, et_driver, et_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, et, et_devices,
sizeof(et_devices[0]), nitems(et_devices) - 1);
nitems(et_devices) - 1);
DRIVER_MODULE(miibus, et, miibus_driver, miibus_devclass, 0, 0);

static int et_rx_intr_npkts = 32;
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/fxp/if_fxp.c
Expand Up @@ -308,7 +308,7 @@ static devclass_t fxp_devclass;
DRIVER_MODULE_ORDERED(fxp, pci, fxp_driver, fxp_devclass, NULL, NULL,
SI_ORDER_ANY);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, fxp, fxp_ident_table,
sizeof(fxp_ident_table[0]), nitems(fxp_ident_table) - 1);
nitems(fxp_ident_table) - 1);
DRIVER_MODULE(miibus, fxp, miibus_driver, miibus_devclass, NULL, NULL);

static struct resource_spec fxp_res_spec_mem[] = {
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/gem/if_gem_pci.c
Expand Up @@ -116,7 +116,7 @@ static driver_t gem_pci_driver = {

DRIVER_MODULE(gem, pci, gem_pci_driver, gem_devclass, 0, 0);
MODULE_PNP_INFO("W32:vendor/device", pci, gem, gem_pci_devlist,
sizeof(gem_pci_devlist[0]), nitems(gem_pci_devlist) - 1);
nitems(gem_pci_devlist) - 1);
MODULE_DEPEND(gem, pci, 1, 1, 1);
MODULE_DEPEND(gem, ether, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/intpm/intpm.c
Expand Up @@ -896,4 +896,4 @@ DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
MODULE_VERSION(intsmb, 1);
MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products,
sizeof(intsmb_products[0]), nitems(intsmb_products));
nitems(intsmb_products));
2 changes: 1 addition & 1 deletion sys/dev/ioat/ioat.c
Expand Up @@ -241,7 +241,7 @@ static struct _pcsid
};

MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids,
sizeof(pci_ids[0]), nitems(pci_ids));
nitems(pci_ids));

/*
* OS <-> Driver linkage functions
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ipw/if_ipw.c
Expand Up @@ -203,7 +203,7 @@ static devclass_t ipw_devclass;

DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ipw, ipw_ident_table,
sizeof(ipw_ident_table[0]), nitems(ipw_ident_table) - 1);
nitems(ipw_ident_table) - 1);

MODULE_VERSION(ipw, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ixgbe/if_ix.c
Expand Up @@ -238,7 +238,7 @@ static driver_t ix_driver = {
devclass_t ix_devclass;
DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, ix, ixgbe_vendor_info_array,
sizeof(ixgbe_vendor_info_array[0]), nitems(ixgbe_vendor_info_array) - 1);
nitems(ixgbe_vendor_info_array) - 1);

MODULE_DEPEND(ix, pci, 1, 1, 1);
MODULE_DEPEND(ix, ether, 1, 1, 1);
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ixgbe/if_ixv.c
Expand Up @@ -144,7 +144,7 @@ static driver_t ixv_driver = {
devclass_t ixv_devclass;
DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device", pci, ixv, ixv_vendor_info_array,
sizeof(ixv_vendor_info_array[0]), nitems(ixv_vendor_info_array) - 1);
nitems(ixv_vendor_info_array) - 1);
MODULE_DEPEND(ixv, pci, 1, 1, 1);
MODULE_DEPEND(ixv, ether, 1, 1, 1);
#ifdef DEV_NETMAP
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ncr/ncr.c
Expand Up @@ -7109,7 +7109,7 @@ static devclass_t ncr_devclass;

DRIVER_MODULE(ncr, pci, ncr_driver, ncr_devclass, 0, 0);
MODULE_PNP_INFO("W32:vendor/device;U16:#;D:#", pci, ncr, ncr_chip_table,
sizeof(ncr_chip_table[0]), nitems(ncr_chip_table));
nitems(ncr_chip_table));
MODULE_DEPEND(ncr, cam, 1, 1, 1);
MODULE_DEPEND(ncr, pci, 1, 1, 1);

Expand Down
2 changes: 1 addition & 1 deletion sys/dev/ntb/ntb_hw/ntb_hw_intel.c
Expand Up @@ -3120,4 +3120,4 @@ DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb_hw_devclass, NULL, NULL);
MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1);
MODULE_VERSION(ntb_hw_intel, 1);
MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ntb_hw_intel, pci_ids,
sizeof(pci_ids[0]), nitems(pci_ids));
nitems(pci_ids));
2 changes: 1 addition & 1 deletion sys/dev/ofw/ofw_bus_subr.h
Expand Up @@ -67,7 +67,7 @@ struct intr_map_data_fdt {

#define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;"
#define SIMPLEBUS_PNP_INFO(t) \
MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0]));
MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / sizeof(t[0]));

/* Generic implementation of ofw_bus_if.m methods and helper routines */
int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t);
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/pccard/pccardvar.h
Expand Up @@ -102,7 +102,7 @@ struct pccard_product {
*/
#define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;"
#define PCCARD_PNP_INFO(t) \
MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \
MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, nitems(t) - 1)

typedef int (*pccard_product_match_fn) (device_t dev,
const struct pccard_product *ent, int vpfmatch);
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/pci/pcivar.h
Expand Up @@ -311,7 +311,7 @@ struct pci_device_table {
"M16:mask;U16:vendor;U16:device;U16:subvendor;U16:subdevice;" \
"U16:class;U16:subclass;U16:revid;"
#define PCI_PNP_INFO(table) \
MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(PCI_PNP_STR, pci, table, table, \
sizeof(table) / sizeof(table[0]))

const struct pci_device_table *pci_match_device(device_t child,
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/puc/puc_pci.c
Expand Up @@ -200,4 +200,4 @@ static driver_t puc_pci_driver = {

DRIVER_MODULE(puc, pci, puc_pci_driver, puc_devclass, 0, 0);
MODULE_PNP_INFO("U16:vendor;U16:device;U16:#;U16:#;D:#", pci, puc,
puc_pci_devices, sizeof(puc_pci_devices[0]), nitems(puc_pci_devices) - 1);
puc_pci_devices, nitems(puc_pci_devices) - 1);
2 changes: 1 addition & 1 deletion sys/dev/spibus/spi.h
Expand Up @@ -43,4 +43,4 @@ struct spi_command {

#define SPIBUS_PNP_DESCR "Z:compat;P:#;"
#define SPIBUS_PNP_INFO(t) \
MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0]));
MODULE_PNP_INFO(SPIBUS_PNP_DESCR, spibus, t, t, sizeof(t) / sizeof(t[0]));
2 changes: 1 addition & 1 deletion sys/dev/uart/uart_bus_pccard.c
Expand Up @@ -103,4 +103,4 @@ uart_pccard_attach(device_t dev)

DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0);
MODULE_PNP_INFO("U32:function_type;", pccard, uart, &uart_pccard_function,
sizeof(uart_pccard_function), 1);
1);
6 changes: 3 additions & 3 deletions sys/dev/usb/usbdi.h
Expand Up @@ -342,13 +342,13 @@ struct usb_device_id {
#define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;"
#define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;"
#define USB_PNP_HOST_INFO(table) \
MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, \
sizeof(table) / sizeof(table[0]))
#define USB_PNP_DEVICE_INFO(table) \
MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, \
sizeof(table) / sizeof(table[0]))
#define USB_PNP_DUAL_INFO(table) \
MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, \
sizeof(table) / sizeof(table[0]))

/* check that the size of the structure above is correct */
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/xl/if_xl.c
Expand Up @@ -334,7 +334,7 @@ static devclass_t xl_devclass;
DRIVER_MODULE_ORDERED(xl, pci, xl_driver, xl_devclass, NULL, NULL,
SI_ORDER_ANY);
DRIVER_MODULE(miibus, xl, miibus_driver, miibus_devclass, NULL, NULL);
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs, sizeof(xl_devs[0]),
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, xl, xl_devs,
nitems(xl_devs) - 1);

static void
Expand Down
2 changes: 1 addition & 1 deletion sys/isa/isavar.h
Expand Up @@ -142,7 +142,7 @@ enum isa_device_ivars {

#define ISA_PNP_DESCR "E:pnpid;D:#"
#define ISA_PNP_INFO(t) \
MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, sizeof(t[0]), nitems(t) - 1); \
MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, nitems(t) - 1); \

/*
* Simplified accessors for isa devices
Expand Down
2 changes: 1 addition & 1 deletion sys/net/iflib.h
Expand Up @@ -173,7 +173,7 @@ typedef struct pci_vendor_info {
#define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \
"U32:revision;U32:class;D:#"
#define IFLIB_PNP_INFO(b, u, t) \
MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t) - 1)
MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, nitems(t) - 1)

typedef struct if_txrx {
int (*ift_txd_encap) (void *, if_pkt_info_t);
Expand Down

0 comments on commit 8efc2b3

Please sign in to comment.