aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/alc/if_alc.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-09-26 17:12:14 +0000
committerWarner Losh <imp@FreeBSD.org>2018-09-26 17:12:14 +0000
commit329e817fcc97aa847765c5171cc89a81a0b25527 (patch)
treeef997f398912dc47f9b0b15d284552e6c6bdc0cc /sys/dev/alc/if_alc.c
parentc5bf4b1bc690dc122ed4a472672d97af64baab5f (diff)
downloadsrc-329e817fcc97aa847765c5171cc89a81a0b25527.tar.gz
src-329e817fcc97aa847765c5171cc89a81a0b25527.zip
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)
Notes
Notes: svn path=/head/; revision=338948
Diffstat (limited to 'sys/dev/alc/if_alc.c')
-rw-r--r--sys/dev/alc/if_alc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c
index ede7bd49c193..1bafdab235d0 100644
--- a/sys/dev/alc/if_alc.c
+++ b/sys/dev/alc/if_alc.c
@@ -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[] = {