Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modules/battery): make rate positive if negative #3104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

classabbyamp
Copy link

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

On the Lenovo X13s, the battery firmware returns a negative value for power_now, which is interpreted by the battery module as 0UL because it converts the string to unsigned long. This should be read as a long instead, as the kernel specifies that power_now is an int: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/power_supply.h?h=v6.0.11#n99

Related Issues & Documents

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

on the Lenovo X13s, the battery firmware returns a negative value for
power_now, which is interpreted by the battery module as 0 because it
converts the string to unsigned long. This should be read as a long
instead, as the kernel specifies that power_now is an int:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/power_supply.h?h=v6.0.11#n99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant