Module Name:    src
Committed By:   christos
Date:           Mon Oct  5 15:57:50 UTC 2015

Modified Files:
        src/sys/dev/acpi: valz_acpi.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/valz_acpi.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/acpi/valz_acpi.c
diff -u src/sys/dev/acpi/valz_acpi.c:1.6 src/sys/dev/acpi/valz_acpi.c:1.7
--- src/sys/dev/acpi/valz_acpi.c:1.6	Sat Sep 26 09:04:10 2015
+++ src/sys/dev/acpi/valz_acpi.c	Mon Oct  5 11:57:50 2015
@@ -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 @@ hci_op(struct valz_acpi_softc *sc, uint3
 		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);

Reply via email to