Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Use __arraycount(3).
details: https://anonhg.NetBSD.org/src/rev/5f608651c12b
branches: trunk
changeset: 762800:5f608651c12b
user: jruoho <jruoho%NetBSD.org@localhost>
date: Tue Mar 01 05:37:02 2011 +0000
description:
Use __arraycount(3).
diffstat:
sys/dev/acpi/acpi_cpu_cstate.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (54 lines):
diff -r 10f7ea9e2e5c -r 5f608651c12b sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c Tue Mar 01 05:32:03 2011 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c Tue Mar 01 05:37:02 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.47 2011/03/01 05:32:03 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.48 2011/03/01 05:37:02 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.47 2011/03/01 05:32:03 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.48 2011/03/01 05:37:02 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -118,9 +118,9 @@
{
struct acpicpu_cstate *cs;
const char *str;
- int i;
+ uint8_t i;
- for (i = 0; i < ACPI_C_STATE_COUNT; i++) {
+ for (i = 0; i < __arraycount(sc->sc_cstate); i++) {
cs = &sc->sc_cstate[i];
@@ -165,9 +165,9 @@
acpicpu_cstate_detach_evcnt(struct acpicpu_softc *sc)
{
struct acpicpu_cstate *cs;
- int i;
+ uint8_t i;
- for (i = 0; i < ACPI_C_STATE_COUNT; i++) {
+ for (i = 0; i < __arraycount(sc->sc_cstate); i++) {
cs = &sc->sc_cstate[i];
@@ -477,9 +477,9 @@
static void
acpicpu_cstate_memset(struct acpicpu_softc *sc)
{
- int i = 0;
+ uint8_t i = 0;
- while (i < ACPI_C_STATE_COUNT) {
+ while (i < __arraycount(sc->sc_cstate)) {
sc->sc_cstate[i].cs_addr = 0;
sc->sc_cstate[i].cs_power = 0;
Home |
Main Index |
Thread Index |
Old Index