From 5c619d89efd040cc4a35c828a9c780c41628ea49 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sun, 23 Nov 2008 12:46:52 +0000 Subject: sizeofa -> nitems --- sys/dev/ic/sili.c | 6 +++--- sys/dev/ic/silivar.h | 4 +--- sys/dev/pci/sili_pci.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c index 8ff8ca2db70..fc5e849e8f6 100644 --- a/sys/dev/ic/sili.c +++ b/sys/dev/ic/sili.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili.c,v 1.39 2007/11/28 13:47:09 dlg Exp $ */ +/* $OpenBSD: sili.c,v 1.40 2008/11/23 12:46:51 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -838,14 +838,14 @@ sili_ata_cmd(struct ata_xfer *xa) atapi->control = htole16(SILI_PRB_PACKET_READ); sgl = atapi->sgl; - sgllen = sizeofa(atapi->sgl); + sgllen = nitems(atapi->sgl); } else { ata = ccb->ccb_cmd; ata->control = 0; sgl = ata->sgl; - sgllen = sizeofa(ata->sgl); + sgllen = nitems(ata->sgl); } if (sili_load(ccb, sgl, sgllen) != 0) diff --git a/sys/dev/ic/silivar.h b/sys/dev/ic/silivar.h index e1a1e3a0498..dab11d6f338 100644 --- a/sys/dev/ic/silivar.h +++ b/sys/dev/ic/silivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: silivar.h,v 1.5 2007/04/07 05:59:49 dlg Exp $ */ +/* $OpenBSD: silivar.h,v 1.6 2008/11/23 12:46:51 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define sizeofa(_a) (sizeof(_a) / sizeof((_a)[0])) - struct sili_port; struct sili_softc { diff --git a/sys/dev/pci/sili_pci.c b/sys/dev/pci/sili_pci.c index e8be243e27e..90c3c44e5d7 100644 --- a/sys/dev/pci/sili_pci.c +++ b/sys/dev/pci/sili_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili_pci.c,v 1.8 2007/11/23 18:18:58 dlg Exp $ */ +/* $OpenBSD: sili_pci.c,v 1.9 2008/11/23 12:46:51 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -77,7 +77,7 @@ sili_lookup(struct pci_attach_args *pa) int i; const struct sili_device *sd; - for (i = 0; i < sizeofa(sili_devices); i++) { + for (i = 0; i < nitems(sili_devices); i++) { sd = &sili_devices[i]; if (sd->sd_vendor == PCI_VENDOR(pa->pa_id) && sd->sd_product == PCI_PRODUCT(pa->pa_id)) -- cgit v1.2.3