Simplify checks for valid battery info via DeMorgan's Rule. No

functional change.
This commit is contained in:
Nate Lawson 2005-11-23 00:53:01 +00:00
parent 1dab802e37
commit f08e63dc4d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=152703

View File

@ -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. */