diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-21 15:38:28 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-21 15:38:28 +0000 |
commit | fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8 (patch) | |
tree | 45622d9ce5a6c394316a37f672cfd0a033c48374 /sys/dev/sge | |
parent | fdf39652a42767663d4a74a1a367d193185c51e9 (diff) | |
download | FreeBSD-src-fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8.zip FreeBSD-src-fc65edc1cd05de15ef17e14dc54c2bf6c41ccab8.tar.gz |
Remove slightly used const values that can be replaced with nitems().
Suggested by: jhb
Diffstat (limited to 'sys/dev/sge')
-rw-r--r-- | sys/dev/sge/if_sge.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/sge/if_sge.c b/sys/dev/sge/if_sge.c index f0ef07f..9aefce1 100644 --- a/sys/dev/sge/if_sge.c +++ b/sys/dev/sge/if_sge.c @@ -276,9 +276,8 @@ sge_get_mac_addr_apc(struct sge_softc *sc, uint8_t *dest) { SIS_VENDORID, 0x0968 } }; uint8_t reg; - int busnum, cnt, i, j, numkids; + int busnum, i, j, numkids; - cnt = sizeof(apc_tbls) / sizeof(apc_tbls[0]); pci = devclass_find("pci"); for (busnum = 0; busnum < devclass_get_maxunit(pci); busnum++) { bus = devclass_get_device(pci, busnum); @@ -291,7 +290,7 @@ sge_get_mac_addr_apc(struct sge_softc *sc, uint8_t *dest) if (pci_get_class(dev) == PCIC_BRIDGE && pci_get_subclass(dev) == PCIS_BRIDGE_ISA) { tp = apc_tbls; - for (j = 0; j < cnt; j++) { + for (j = 0; j < nitems(apc_tbls); j++) { if (pci_get_vendor(dev) == tp->vid && pci_get_device(dev) == tp->did) { free(kids, M_TEMP); |