Skip to content
Commit d719870b authored by Mariusz Ceier's avatar Mariusz Ceier Committed by Rafael J. Wysocki
Browse files

ACPI / battery: Fix warning message in acpi_battery_get_state()



capacity_now should be assigned after comparing it to design_capacity.

Otherwise warning is printed even when capacity_now before assignment is
equal to design_capacity, making the check useless and "current charge level"
wrong (it should be higher than, not equal to, "maximum charge level", which
is full_charge_capacity):

"battery: reported current charge level (56410) is higher than reported
maximum charge level (56410)."

Fixes: 232de514 (ACPI / battery: fix wrong value of capacity_now reported when fully charged)
Signed-off-by: default avatarMariusz Ceier <mceier+kernel@gmail.com>
Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
[rjw: Subject]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3a54a57d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment