]> www.infradead.org Git - users/jedix/linux-maple.git/commit
power: supply: Use str_enable_disable-like helpers
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 14 Jan 2025 20:36:11 +0000 (21:36 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 15 Jan 2025 20:41:22 +0000 (21:41 +0100)
commit2d678e3e1e1564780562614ebb099a1e8cbd025f
treeebfd8870769d51679a1308eb1ad3673e4dbb8dac
parenta3a8799165ff83bb764fd800c6559c3cba0ddac3
power: supply: Use str_enable_disable-like helpers

Replace ternary (condition ? "enable" : "disable") syntax with helpers
from string_choices.h because:
1. Simple function call with one argument is easier to read.  Ternary
   operator has three arguments and with wrapping might lead to quite
   long code.
2. Is slightly shorter thus also easier to read.
3. It brings uniformity in the text - same string.
4. Allows deduping by the linker, which results in a smaller binary
   file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250114203611.1013324-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/88pm860x_battery.c
drivers/power/supply/charger-manager.c
drivers/power/supply/cpcap-charger.c
drivers/power/supply/da9030_battery.c
drivers/power/supply/sbs-battery.c