Simplify checks for valid battery info via DeMorgan's Rule. No
functional change.
This commit is contained in:
parent
1dab802e37
commit
f08e63dc4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=152703
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user