aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/amr/amr_pci.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-08-19 00:22:21 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-08-19 00:22:21 +0000
commitfaa319436f0d548cff97c2c8c763538997b63f34 (patch)
tree83d929a61077c1eee88b03c7698a3fcbfab6df73 /sys/dev/amr/amr_pci.c
parent94d0f0877db6bf0511dc0198e78b870618f42d3e (diff)
downloadsrc-faa319436f0d548cff97c2c8c763538997b63f34.tar.gz
src-faa319436f0d548cff97c2c8c763538997b63f34.zip
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).
Notes
Notes: svn path=/head/; revision=338035
Diffstat (limited to 'sys/dev/amr/amr_pci.c')
-rw-r--r--sys/dev/amr/amr_pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c
index 80cd58b5ccd3..25b37eda3895 100644
--- a/sys/dev/amr/amr_pci.c
+++ b/sys/dev/amr/amr_pci.c
@@ -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);