diff options
author | njl <njl@FreeBSD.org> | 2005-08-11 17:12:57 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-08-11 17:12:57 +0000 |
commit | eb0b6b05e446502b69adaee892659eed5b4b041d (patch) | |
tree | ff70c139a79f70d274fb80fed9528c975fbb03f4 | |
parent | 7c459235b2994c63440e931f1c59b0bea310f45e (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/dev/acpica/acpi_battery.c | 5 |
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; } /* |