summaryrefslogtreecommitdiffstats
path: root/sys/dev/aic
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-21 19:40:10 +0000
committerpfg <pfg@FreeBSD.org>2016-04-21 19:40:10 +0000
commit42747553f484b2cfcfb919643e1749c9ad782766 (patch)
treeeafad75827e36e967c59edef51d49100cec9cad4 /sys/dev/aic
parentb98e219695917390f708c219fcd6bc8938cea0e2 (diff)
downloadFreeBSD-src-42747553f484b2cfcfb919643e1749c9ad782766.zip
FreeBSD-src-42747553f484b2cfcfb919643e1749c9ad782766.tar.gz
sys: use our nitems() macro when param.h is available.
This should cover all the remaining cases in the kernel. Discussed in: freebsd-current
Diffstat (limited to 'sys/dev/aic')
-rw-r--r--sys/dev/aic/aic.c2
-rw-r--r--sys/dev/aic/aic_cbus.c3
-rw-r--r--sys/dev/aic/aic_isa.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/aic/aic.c b/sys/dev/aic/aic.c
index 7d4e1ef..90414a7 100644
--- a/sys/dev/aic/aic.c
+++ b/sys/dev/aic/aic.c
@@ -1443,7 +1443,7 @@ aic_init(struct aic_softc *aic)
aic->chip_type = AIC6260;
aic_insb(aic, ID, chip_id, sizeof(chip_id) - 1);
chip_id[sizeof(chip_id) - 1] = '\0';
- for (i = 0; i < sizeof(aic_chip_ids) / sizeof(aic_chip_ids[0]); i++) {
+ for (i = 0; i < nitems(aic_chip_ids); i++) {
if (!strcmp(chip_id, aic_chip_ids[i].idstring)) {
aic->chip_type = aic_chip_ids[i].type;
break;
diff --git a/sys/dev/aic/aic_cbus.c b/sys/dev/aic/aic_cbus.c
index d2d2bc3..84e7f7b 100644
--- a/sys/dev/aic/aic_cbus.c
+++ b/sys/dev/aic/aic_cbus.c
@@ -57,7 +57,8 @@ static int aic_isa_probe(device_t);
static int aic_isa_attach(device_t);
static u_int aic_isa_ports[] = { 0x1840 };
-#define AIC_ISA_NUMPORTS (sizeof(aic_isa_ports) / sizeof(aic_isa_ports[0]))
+
+#define AIC_ISA_NUMPORTS nitems(aic_isa_ports)
#define AIC_ISA_PORTSIZE 0x20
#define AIC98_GENERIC 0x00
diff --git a/sys/dev/aic/aic_isa.c b/sys/dev/aic/aic_isa.c
index 7e8c239..a134312 100644
--- a/sys/dev/aic/aic_isa.c
+++ b/sys/dev/aic/aic_isa.c
@@ -57,7 +57,7 @@ static int aic_isa_probe(device_t);
static int aic_isa_attach(device_t);
static u_int aic_isa_ports[] = { 0x340, 0x140 };
-#define AIC_ISA_NUMPORTS (sizeof(aic_isa_ports) / sizeof(aic_isa_ports[0]))
+#define AIC_ISA_NUMPORTS (nitems(aic_isa_ports))
#define AIC_ISA_PORTSIZE 0x20
static struct isa_pnp_id aic_ids[] = {
OpenPOWER on IntegriCloud