Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi - Fix typo in a message.



details:   https://anonhg.NetBSD.org/src/rev/7683e994b261
branches:  trunk
changeset: 535422:7683e994b261
user:      kanaoka <kanaoka%NetBSD.org@localhost>
date:      Sun Aug 18 07:45:04 2002 +0000

description:
- Fix typo in a message.
- Avoid to divide by 0.
   When booting without battery, sc->sc_design_capacity become 0.

diffstat:

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

diffs (37 lines):

diff -r 8c862c7bc647 -r 7683e994b261 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c   Sun Aug 18 07:40:04 2002 +0000
+++ b/sys/dev/acpi/acpi_bat.c   Sun Aug 18 07:45:04 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_bat.c,v 1.2 2002/08/02 16:51:48 explorer Exp $    */
+/*     $NetBSD: acpi_bat.c,v 1.3 2002/08/18 07:45:04 kanaoka Exp $     */
 
 /*
  * Copyright 2001 Bill Sommerfeld.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.2 2002/08/02 16:51:48 explorer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.3 2002/08/18 07:45:04 kanaoka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -240,7 +240,7 @@
 
        rv = acpi_eval_struct(sc->sc_node->ad_handle, "_BST", &buf);
        if (rv != AE_OK) {
-               printf("bat: failed to evaluate _BIF: %x\n", rv);
+               printf("bat: failed to evaluate _BST: %x\n", rv);
                return;
        }
        p1 = (ACPI_OBJECT *)buf.Pointer;
@@ -266,7 +266,8 @@
                               (sc->sc_status & 2) ? "charging" : "idle"),
                       ACM_SCALE(sc->sc_mv),
                       ACM_SCALE(sc->sc_capacity), ACM_CAPUNIT(sc),
-                      (sc->sc_capacity * 100) / sc->sc_design_capacity,
+                      (sc->sc_design_capacity == 0) ? 0 : 
+                           (sc->sc_capacity * 100) / sc->sc_design_capacity,
                       ACM_SCALE(sc->sc_rate), ACM_RATEUNIT(sc));
        }
 out:



Home | Main Index | Thread Index | Old Index