summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2006-12-21 04:54:28 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2006-12-21 04:54:28 +0000
commitea56910070bc0d09bc9f6ce6a92d9b6b18b57314 (patch)
tree87a849679f40aec3fa950fd819f0a361c4c84597 /sys
parent090e4bf049f72fbb581e7646d78f18da6d56f314 (diff)
Fix silly logic errors.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpibat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c
index 3c4c522934e..26424149f1e 100644
--- a/sys/dev/acpi/acpibat.c
+++ b/sys/dev/acpi/acpibat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibat.c,v 1.31 2006/12/21 04:18:48 marco Exp $ */
+/* $OpenBSD: acpibat.c,v 1.32 2006/12/21 04:54:27 marco Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -167,11 +167,12 @@ acpibat_refresh(void *arg)
dnprintf(30, "%s: %s: refresh\n", DEVNAME(sc),
sc->sc_devnode->parent->name);
- if (sc->sc_bat_present == 0) {
+ if (!sc->sc_bat_present) {
for (i = 0; i < 8; i++)
sc->sc_sens[i].value = 0;
strlcpy(sc->sc_sens[4].desc, "battery removed",
sizeof(sc->sc_sens[4].desc));
+ sc->sc_sens[4].status = SENSOR_S_OK;
return;
}
@@ -325,7 +326,7 @@ acpibat_notify(struct aml_node *node, int notify_type, void *arg)
switch (notify_type) {
case 0x80: /* _BST changed */
- if (sc->sc_bat_present == 0) {
+ if (!sc->sc_bat_present) {
printf("%s: %s: inserted\n", DEVNAME(sc),
sc->sc_devnode->parent->name);
sc->sc_bat_present = 1;
@@ -333,7 +334,7 @@ acpibat_notify(struct aml_node *node, int notify_type, void *arg)
break;
case 0x81: /* _BIF changed */
/* XXX consider this a device removal */
- if (sc->sc_bat_present == 1) {
+ if (sc->sc_bat_present) {
printf("%s: %s: removed\n", DEVNAME(sc),
sc->sc_devnode->parent->name);
sc->sc_bat_present = 0;