summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge/if_bge.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2012-06-02 19:41:28 +0000
committermarius <marius@FreeBSD.org>2012-06-02 19:41:28 +0000
commit5ef7d2624d9addd62e306a8cbcccfe078c717c31 (patch)
treeaaa525edc723998cd6992bf4bf5708fc84192682 /sys/dev/bge/if_bge.c
parent3c3d727c68a1120d1726c88e607e639e1e6d880a (diff)
downloadFreeBSD-src-5ef7d2624d9addd62e306a8cbcccfe078c717c31.zip
FreeBSD-src-5ef7d2624d9addd62e306a8cbcccfe078c717c31.tar.gz
Take advantage of nitems().
MFC after: 3 days
Diffstat (limited to 'sys/dev/bge/if_bge.c')
-rw-r--r--sys/dev/bge/if_bge.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index cbca52b..16cfe27 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -2766,9 +2766,8 @@ bge_mbox_reorder(struct bge_softc *sc)
};
devclass_t pci, pcib;
device_t bus, dev;
- int count, i;
+ int i;
- count = sizeof(mbox_reorder_lists) / sizeof(mbox_reorder_lists[0]);
pci = devclass_find("pci");
pcib = devclass_find("pcib");
dev = sc->bge_dev;
@@ -2778,7 +2777,7 @@ bge_mbox_reorder(struct bge_softc *sc)
bus = device_get_parent(dev);
if (device_get_devclass(dev) != pcib)
break;
- for (i = 0; i < count; i++) {
+ for (i = 0; i < nitems(mbox_reorder_lists); i++) {
if (pci_get_vendor(dev) ==
mbox_reorder_lists[i].vendor &&
pci_get_device(dev) ==
OpenPOWER on IntegriCloud