diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-19 23:37:24 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-19 23:37:24 +0000 |
commit | e2a6cba6516fcfe2c4f3ff73d0f9aa0ba261f548 (patch) | |
tree | 346d2ff1b645f831d2f412a7a4be3f6eb1c711b4 /sys/dev/digi | |
parent | ea58c6f194dc25f7e2e87f7a36de9b2da5b8b90c (diff) | |
download | FreeBSD-src-e2a6cba6516fcfe2c4f3ff73d0f9aa0ba261f548.zip FreeBSD-src-e2a6cba6516fcfe2c4f3ff73d0f9aa0ba261f548.tar.gz |
sys/dev: use our nitems() macro when it is avaliable through param.h.
No functional change, only trivial cases are done in this sweep,
Drivers that can get further enhancements will be done independently.
Discussed in: freebsd-current
Diffstat (limited to 'sys/dev/digi')
-rw-r--r-- | sys/dev/digi/digi.c | 4 | ||||
-rw-r--r-- | sys/dev/digi/digi_isa.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index 7adc72a..b8ede24 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -1441,8 +1441,8 @@ digi_errortxt(int id) "tty-level buffer overflow", }; - KASSERT(id >= 0 && id < sizeof(error_desc) / sizeof(error_desc[0]), - ("Unexpected digi error id %d\n", id)); + KASSERT(id >= 0 && id < nitems(error_desc), + ("Unexpected digi error id %d\n", id)); return (error_desc[id]); } diff --git a/sys/dev/digi/digi_isa.c b/sys/dev/digi/digi_isa.c index 647ea1d..d549110 100644 --- a/sys/dev/digi/digi_isa.c +++ b/sys/dev/digi/digi_isa.c @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); static u_long digi_validio[] = { 0x100, 0x110, 0x120, 0x200, 0x220, 0x300, 0x320 }; -#define DIGI_NVALIDIO (sizeof(digi_validio) / sizeof(digi_validio[0])) +#define DIGI_NVALIDIO nitems(digi_validio) #define IO_SIZE 0x04 static u_long digi_validmem[] = { @@ -68,7 +68,7 @@ static u_long digi_validmem[] = { 0xf6000000, 0xf7000000, 0xf8000000, 0xf9000000, 0xfa000000, 0xfb000000, 0xfc000000, 0xfd000000, 0xfe000000, 0xff000000 }; -#define DIGI_NVALIDMEM (sizeof(digi_validmem) / sizeof(digi_validmem[0])) +#define DIGI_NVALIDMEM (nitems(digi_validmem)) static u_char * digi_isa_setwin(struct digi_softc *sc, unsigned int addr) |