]> www.infradead.org Git - nvme.git/commit
power: supply: cros_charge-control: Fix signedness bug in charge_behaviour_store()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 4 Jul 2024 15:20:03 +0000 (10:20 -0500)
committerTzung-Bi Shih <tzungbi@kernel.org>
Fri, 5 Jul 2024 01:51:33 +0000 (01:51 +0000)
commit4baf1cc54433ff7c6e5178517bc8768001416681
treeb3557a25637a221544ab76bd3e28632f4dc1fb47
parentc98f17fec35e46629272226a898ebb0a653ee270
power: supply: cros_charge-control: Fix signedness bug in charge_behaviour_store()

The C standard is vague about the signedness of enums, but in this case
here, they are treated as unsigned so the error handling does not work.
Use an int type to fix this.

Fixes: c6ed48ef5259 ("power: supply: add ChromeOS EC based charge control driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/ZoWKEs4mCqeLyTOB@stanley.mountain
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/power/supply/cros_charge-control.c