Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi CID 1324963: Remove bogus NULL test



details:   https://anonhg.NetBSD.org/src/rev/f896facfffe4
branches:  trunk
changeset: 810869:f896facfffe4
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 26 13:04:10 2015 +0000

description:
CID 1324963: Remove bogus NULL test
CID 1324962: This is not python, one needs braces too.

diffstat:

 sys/dev/acpi/valz_acpi.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r c4359fbaff39 -r f896facfffe4 sys/dev/acpi/valz_acpi.c
--- a/sys/dev/acpi/valz_acpi.c  Sat Sep 26 12:16:28 2015 +0000
+++ b/sys/dev/acpi/valz_acpi.c  Sat Sep 26 13:04:10 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: valz_acpi.c,v 1.5 2015/09/21 12:32:06 nonaka Exp $     */
+/*     $NetBSD: valz_acpi.c,v 1.6 2015/09/26 13:04:10 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.5 2015/09/21 12:32:06 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: valz_acpi.c,v 1.6 2015/09/26 13:04:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -420,13 +420,13 @@
        param = (ACPI_OBJECT *)buf.Pointer;
        PrtElement = param->Package.Elements;
        for (i = 0; i < HCI_WORDS; i++) {
-               if (PrtElement->Type == ACPI_TYPE_INTEGER)
+               if (PrtElement->Type == ACPI_TYPE_INTEGER) {
                        output[i] = PrtElement->Integer.Value;
                        PrtElement++;
+               }
        }
 
-       if (buf.Pointer)
-               ACPI_FREE(buf.Pointer);
+       ACPI_FREE(buf.Pointer);
 
        return rv;
 }



Home | Main Index | Thread Index | Old Index