Module Name:    src
Committed By:   pgoyette
Date:           Wed Aug 19 16:31:28 UTC 2009

Modified Files:
        src/sys/dev/pci: ahcisata_pci.c pci_quirks.c

Log Message:
Use __arraycount() for readability


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ahcisata_pci.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/pci_quirks.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.15 src/sys/dev/pci/ahcisata_pci.c:1.16
--- src/sys/dev/pci/ahcisata_pci.c:1.15	Thu Jun 11 11:02:11 2009
+++ src/sys/dev/pci/ahcisata_pci.c	Wed Aug 19 16:31:28 2009
@@ -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 @@
 {
 	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]);

Index: src/sys/dev/pci/pci_quirks.c
diff -u src/sys/dev/pci/pci_quirks.c:1.8 src/sys/dev/pci/pci_quirks.c:1.9
--- src/sys/dev/pci/pci_quirks.c:1.8	Sat Jan  6 00:08:20 2007
+++ src/sys/dev/pci/pci_quirks.c	Wed Aug 19 16:31:28 2009
@@ -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 @@
 {
 	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]);

Reply via email to