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 a define instead of a magic constant for th...



details:   https://anonhg.NetBSD.org/src/rev/bdc503724457
branches:  trunk
changeset: 757033:bdc503724457
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Aug 11 11:48:21 2010 +0000

description:
Use a define instead of a magic constant for the arbitrary P-state limit.

diffstat:

 sys/dev/acpi/acpi_cpu.h        |  3 ++-
 sys/dev/acpi/acpi_cpu_pstate.c |  6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r f24d417d2ce7 -r bdc503724457 sys/dev/acpi/acpi_cpu.h
--- a/sys/dev/acpi/acpi_cpu.h   Wed Aug 11 11:47:29 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.h   Wed Aug 11 11:48:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.12 2010/08/10 02:42:05 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.13 2010/08/11 11:48:21 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -84,6 +84,7 @@
 /*
  * P-states.
  */
+#define ACPICPU_P_STATE_MAX     255            /* Arbitrary upper limit     */
 #define ACPICPU_P_STATE_RETRY   100
 #define ACPICPU_P_STATE_UNKNOWN         0x0
 
diff -r f24d417d2ce7 -r bdc503724457 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c    Wed Aug 11 11:47:29 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c    Wed Aug 11 11:48:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.8 2010/08/11 10:44:07 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.9 2010/08/11 11:48:21 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.8 2010/08/11 10:44:07 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.9 2010/08/11 11:48:21 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
@@ -281,7 +281,7 @@
                goto out;
        }
 
-       if (sc->sc_pstate_count > 0xFF) {
+       if (sc->sc_pstate_count > ACPICPU_P_STATE_MAX) {
                rv = AE_LIMIT;
                goto out;
        }



Home | Main Index | Thread Index | Old Index