diff options
author | njl <njl@FreeBSD.org> | 2005-11-23 00:53:01 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-11-23 00:53:01 +0000 |
commit | 760a197f7dccc166ae51ad40d57d71ca14311251 (patch) | |
tree | 6327b4f37ba5236b30fc84757ed699cb61f6ed08 | |
parent | 76c4913a46e32608470409c9c022164d12f8006b (diff) | |
download | FreeBSD-src-760a197f7dccc166ae51ad40d57d71ca14311251.zip FreeBSD-src-760a197f7dccc166ae51ad40d57d71ca14311251.tar.gz |
Simplify checks for valid battery info via DeMorgan's Rule. No
functional change.
-rw-r--r-- | sys/dev/acpica/acpi_battery.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c index 0bfe9d7..65ae958 100644 --- a/sys/dev/acpica/acpi_battery.c +++ b/sys/dev/acpica/acpi_battery.c @@ -101,21 +101,15 @@ acpi_battery_get_info_expire(void) int acpi_battery_bst_valid(struct acpi_bst *bst) { - if (bst->state >= ACPI_BATT_STAT_MAX || bst->cap == ACPI_BATT_UNKNOWN || - bst->volt == ACPI_BATT_UNKNOWN) - return (FALSE); - else - return (TRUE); + return (bst->state < ACPI_BATT_STAT_MAX && bst->cap != ACPI_BATT_UNKNOWN && + bst->volt != ACPI_BATT_UNKNOWN); } /* Check _BIF results for validity. */ int acpi_battery_bif_valid(struct acpi_bif *bif) { - if (bif->lfcap == 0) - return (FALSE); - else - return (TRUE); + return (bif->lfcap != 0); } /* Get info about one or all batteries. */ |