Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Use __arraycount() for readability



details:   https://anonhg.NetBSD.org/src/rev/d1cb972bfdde
branches:  trunk
changeset: 746778:d1cb972bfdde
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Aug 19 16:31:28 2009 +0000

description:
Use __arraycount() for readability

diffstat:

 sys/dev/pci/ahcisata_pci.c |  7 +++----
 sys/dev/pci/pci_quirks.c   |  6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 0b0cc198f835 -r d1cb972bfdde sys/dev/pci/ahcisata_pci.c
--- a/sys/dev/pci/ahcisata_pci.c        Wed Aug 19 16:23:28 2009 +0000
+++ b/sys/dev/pci/ahcisata_pci.c        Wed Aug 19 16:31:28 2009 +0000
@@ -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]);
diff -r 0b0cc198f835 -r d1cb972bfdde sys/dev/pci/pci_quirks.c
--- a/sys/dev/pci/pci_quirks.c  Wed Aug 19 16:23:28 2009 +0000
+++ b/sys/dev/pci/pci_quirks.c  Wed Aug 19 16:31:28 2009 +0000
@@ -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]);



Home | Main Index | Thread Index | Old Index