Use __arraycount() for readability

This commit is contained in:
pgoyette 2009-08-19 16:31:28 +00:00
parent 06ffd276b6
commit 96961f175f
2 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahcisata_pci.c,v 1.15 2009/06/11 11:02:11 cegger Exp $ */
/* $NetBSD: ahcisata_pci.c,v 1.16 2009/08/19 16:31:28 pgoyette Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.15 2009/06/11 11:02:11 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.16 2009/08/19 16:31:28 pgoyette Exp $");
#include <sys/types.h>
#include <sys/malloc.h>
@ -197,8 +197,7 @@ ahci_pci_lookup_quirkdata(pci_vendor_id_t vendor, pci_product_id_t product)
{
int i;
for (i = 0; i < (sizeof ahci_pci_quirks / sizeof ahci_pci_quirks[0]);
i++)
for (i = 0; i < __arraycount(ahci_pci_quirks); i++)
if (vendor == ahci_pci_quirks[i].vendor &&
product == ahci_pci_quirks[i].product)
return (&ahci_pci_quirks[i]);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_quirks.c,v 1.8 2007/01/06 00:08:20 jmcneill Exp $ */
/* $NetBSD: pci_quirks.c,v 1.9 2009/08/19 16:31:28 pgoyette Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci_quirks.c,v 1.8 2007/01/06 00:08:20 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci_quirks.c,v 1.9 2009/08/19 16:31:28 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -56,7 +56,7 @@ pci_lookup_quirkdata(pci_vendor_id_t vendor, pci_product_id_t product)
{
int i;
for (i = 0; i < (sizeof pci_quirks / sizeof pci_quirks[0]); i++)
for (i = 0; i < __arraycount(pci_quirks); i++)
if (vendor == pci_quirks[i].vendor &&
product == pci_quirks[i].product)
return (&pci_quirks[i]);