Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Previous code was mis-indented but correct; sim...



details:   https://anonhg.NetBSD.org/src/rev/5dcb5c4c363d
branches:  trunk
changeset: 340844:5dcb5c4c363d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 05 15:57:50 2015 +0000

description:
Previous code was mis-indented but correct; simplify to make the intent clear.

diffstat:

 sys/dev/acpi/valz_acpi.c |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (37 lines):

diff -r 89d6dae921cd -r 5dcb5c4c363d sys/dev/acpi/valz_acpi.c
--- a/sys/dev/acpi/valz_acpi.c  Mon Oct 05 14:42:19 2015 +0000
+++ b/sys/dev/acpi/valz_acpi.c  Mon Oct 05 15:57:50 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: valz_acpi.c,v 1.6 2015/09/26 13:04:10 christos Exp $   */
+/*     $NetBSD: valz_acpi.c,v 1.7 2015/10/05 15:57:50 christos Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: valz_acpi.c,v 1.6 2015/09/26 13:04:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: valz_acpi.c,v 1.7 2015/10/05 15:57:50 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -414,16 +414,11 @@
                return rv;
        }
 
-       for (i = 0; i < HCI_WORDS; i++) {
-               output[i] = 0;
-       }
        param = (ACPI_OBJECT *)buf.Pointer;
        PrtElement = param->Package.Elements;
        for (i = 0; i < HCI_WORDS; i++) {
-               if (PrtElement->Type == ACPI_TYPE_INTEGER) {
-                       output[i] = PrtElement->Integer.Value;
-                       PrtElement++;
-               }
+               output[i] = PrtElement[i].Type == ACPI_TYPE_INTEGER ?
+                   PrtElement[i].Integer.Value : 0;
        }
 
        ACPI_FREE(buf.Pointer);



Home | Main Index | Thread Index | Old Index