Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Let's not be silly. Use a fancy "if else" to de...



details:   https://anonhg.NetBSD.org/src/rev/50878994d662
branches:  trunk
changeset: 765231:50878994d662
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun May 22 22:13:33 2011 +0000

description:
Let's not be silly. Use a fancy "if else" to decide behavior of a bool
and hope cosmic radition doesn't create a third state.

diffstat:

 sys/dev/acpi/acpi_power.c |  16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diffs (41 lines):

diff -r 7260779719d4 -r 50878994d662 sys/dev/acpi/acpi_power.c
--- a/sys/dev/acpi/acpi_power.c Sun May 22 21:52:25 2011 +0000
+++ b/sys/dev/acpi/acpi_power.c Sun May 22 22:13:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_power.c,v 1.30 2011/04/14 06:25:25 jruoho Exp $ */
+/* $NetBSD: acpi_power.c,v 1.31 2011/05/22 22:13:33 joerg Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.30 2011/04/14 06:25:25 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.31 2011/05/22 22:13:33 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -480,20 +480,12 @@
         * necessary since a single power resource
         * can be shared by multiple devices.
         */
-       switch (on) {
-
-       case true:
+       if (on) {
                rv = acpi_power_res_ref(res, ref);
                str = "_ON";
-               break;
-
-       case false:
+       } else {
                rv = acpi_power_res_deref(res, ref);
                str = "_OFF";
-               break;
-
-       default:
-               return AE_BAD_PARAMETER;
        }
 
        if (ACPI_FAILURE(rv))



Home | Main Index | Thread Index | Old Index