summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2008-11-23 12:51:11 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2008-11-23 12:51:11 +0000
commitb49e168e6b04bb32e80799e7549cb5aa07794d4e (patch)
tree2dab234fe64072c75ac6569ab12ee9e3931c21c3 /sys/dev
parent218e81f5f4e4d271e490acc87c646f895ba769ec (diff)
sizeofa -> nitems
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_nxe.c5
-rw-r--r--sys/dev/pci/mfi_pci.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c
index 81d6706ec5e..42545077a8c 100644
--- a/sys/dev/pci/if_nxe.c
+++ b/sys/dev/pci/if_nxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nxe.c,v 1.57 2008/10/29 01:14:47 deraadt Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.58 2008/11/23 12:51:10 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -833,7 +833,6 @@ int nxe_rom_read_region(struct nxe_softc *, u_int32_t,
/* misc bits */
#define DEVNAME(_sc) ((_sc)->sc_dev.dv_xname)
-#define sizeofa(_a) (sizeof(_a) / sizeof((_a)[0]))
/* let's go! */
@@ -864,7 +863,7 @@ nxe_match(struct device *parent, void *match, void *aux)
if (PCI_CLASS(pa->pa_class) != PCI_CLASS_NETWORK)
return (0);
- return (pci_matchbyid(pa, nxe_devices, sizeofa(nxe_devices)));
+ return (pci_matchbyid(pa, nxe_devices, nitems(nxe_devices)));
}
void
diff --git a/sys/dev/pci/mfi_pci.c b/sys/dev/pci/mfi_pci.c
index 7802b478db3..1f4ddf1ab1a 100644
--- a/sys/dev/pci/mfi_pci.c
+++ b/sys/dev/pci/mfi_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi_pci.c,v 1.17 2008/10/27 03:11:58 marco Exp $ */
+/* $OpenBSD: mfi_pci.c,v 1.18 2008/11/23 12:50:23 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -91,7 +91,6 @@ struct mfi_pci_device {
MFI_IOP_PPC, mfi_1078_subtypes }
};
-#define sizeofa(_a) (sizeof(_a) / sizeof((_a)[0]))
const struct mfi_pci_device *mfi_pci_find_device(struct pci_attach_args *);
const struct mfi_pci_device *
@@ -100,7 +99,7 @@ mfi_pci_find_device(struct pci_attach_args *pa)
const struct mfi_pci_device *mpd;
int i;
- for (i = 0; i < sizeofa(mfi_pci_devices); i++) {
+ for (i = 0; i < nitems(mfi_pci_devices); i++) {
mpd = &mfi_pci_devices[i];
if (mpd->mpd_vendor == PCI_VENDOR(pa->pa_id) &&