Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi back-out previous; it was wrong.



details:   https://anonhg.NetBSD.org/src/rev/b336eb435e39
branches:  trunk
changeset: 543419:b336eb435e39
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 24 20:03:02 2003 +0000

description:
back-out previous; it was wrong.

diffstat:

 sys/dev/acpi/acpi_bat.c |  20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

diffs (71 lines):

diff -r 6285dc17d8f9 -r b336eb435e39 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Mon Feb 24 19:58:09 2003 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Mon Feb 24 20:03:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_bat.c,v 1.17 2003/02/24 19:58:09 christos Exp $   */
+/*     $NetBSD: acpi_bat.c,v 1.18 2003/02/24 20:03:02 christos Exp $   */
 
 /*
  * Copyright 2001 Bill Sommerfeld.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.17 2003/02/24 19:58:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.18 2003/02/24 20:03:02 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -337,12 +337,12 @@
        if (p1->Type != ACPI_TYPE_INTEGER) {
                printf("%s: expected INTEGER, got %d\n", sc->sc_dev.dv_xname,
                       p1->Type);
-               goto out;
+               return (-1);
        }
        if (p1->Package.Count < 1) {
                printf("%s: expected 1 elts, got %d\n",
                       sc->sc_dev.dv_xname, p1->Package.Count);
-               goto out;
+               return (-1);
        }
        sta = p1->Integer.Value;
 
@@ -355,11 +355,7 @@
                sc->sc_data[ACPIBAT_PRESENT].cur.data_s = 0;
        ABAT_UNLOCK(sc, s);
 
-       AcpiOsFree(buf.Pointer);
        return ((sta & ACPIBAT_STA_PRESENT)?1:0);
-out:
-       AcpiOsFree(buf.Pointer);
-       return -1;
 }
 
 /*
@@ -479,11 +475,11 @@
 
        if (p1->Type != ACPI_TYPE_PACKAGE) {
                printf("bat: expected PACKAGE, got %d\n", p1->Type);
-               goto out;
+               return (AE_ERROR);
        }
        if (p1->Package.Count < 4) {
                printf("bat: expected 4 elts, got %d\n", p1->Package.Count);
-               goto out;
+               return (AE_ERROR);
        }
        p2 = p1->Package.Elements;
 
@@ -507,11 +503,7 @@
        sc->sc_available = ABAT_ALV_STAT;
        ABAT_UNLOCK(sc, s);
 
-       AcpiOsFree(buf.Pointer);
        return (AE_OK);
-out:
-       AcpiOsFree(buf.Pointer);
-       return (AE_ERROR);
 }
 
 #define SCALE(x)       ((x)/1000000), (((x)%1000000)/1000)



Home | Main Index | Thread Index | Old Index