summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-08-11 17:12:57 +0000
committernjl <njl@FreeBSD.org>2005-08-11 17:12:57 +0000
commiteb0b6b05e446502b69adaee892659eed5b4b041d (patch)
treeff70c139a79f70d274fb80fed9528c975fbb03f4 /sys
parent7c459235b2994c63440e931f1c59b0bea310f45e (diff)
downloadFreeBSD-src-eb0b6b05e446502b69adaee892659eed5b4b041d.zip
FreeBSD-src-eb0b6b05e446502b69adaee892659eed5b4b041d.tar.gz
Modify the fix in rev 1.16 slightly. Instead of setting the cap to zero,
just skip summing it if it's unknown. MFC after: 1 day
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpica/acpi_battery.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c
index 4099468..218e4d9 100644
--- a/sys/dev/acpica/acpi_battery.c
+++ b/sys/dev/acpica/acpi_battery.c
@@ -227,9 +227,8 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo)
total_min += bi[i].min;
/* If this battery is not present, don't use its capacity. */
- if (bi[i].cap == -1)
- bi[i].cap = 0;
- total_cap += bi[i].cap;
+ if (bi[i].cap != -1)
+ total_cap += bi[i].cap;
}
/*
OpenPOWER on IntegriCloud