diff options
| author | Rong Zhang <i@rong.moe> | 2025-11-06 02:28:24 +0800 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-11-10 11:55:36 +0200 |
| commit | 06c129cac01be45e458d37534d1a6ba753cf6f13 (patch) | |
| tree | 8133dabe5d6a9342d3432eaf91809bf48d64591a /drivers | |
| parent | a9ed446c1908b2feb53314951054e9a259342659 (diff) | |
platform/x86: ideapad-laptop: Use str_on_off() helper
Use the str_on_off() helper instead of open-coding the same operation.
This improves code readability.
No functional change intended.
Suggested-by: kernel test robot <lkp@intel.com>
Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/202510311551.xjWbHTrm-lkp@intel.com/
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/2bae2ea7-2ef9-0cfa-0c2c-39a7043b2aa5@linux.intel.com/
Signed-off-by: Rong Zhang <i@rong.moe>
Link: https://patch.msgid.link/20251105182832.104946-2-i@rong.moe
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/platform/x86/lenovo/ideapad-laptop.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/platform/x86/lenovo/ideapad-laptop.c b/drivers/platform/x86/lenovo/ideapad-laptop.c index fcebfbaf0460..b61ed6993990 100644 --- a/drivers/platform/x86/lenovo/ideapad-laptop.c +++ b/drivers/platform/x86/lenovo/ideapad-laptop.c @@ -31,6 +31,7 @@ #include <linux/power_supply.h> #include <linux/rfkill.h> #include <linux/seq_file.h> +#include <linux/string_choices.h> #include <linux/sysfs.h> #include <linux/types.h> #include <linux/wmi.h> @@ -462,25 +463,25 @@ static int debugfs_status_show(struct seq_file *s, void *data) if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL, &value)) seq_printf(s, "Backlight now: %lu\n", value); if (!read_ec_data(priv->adev->handle, VPCCMD_R_BL_POWER, &value)) - seq_printf(s, "BL power value: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "BL power value: %s (%lu)\n", str_on_off(value), value); seq_puts(s, "=====================\n"); if (!read_ec_data(priv->adev->handle, VPCCMD_R_RF, &value)) - seq_printf(s, "Radio status: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "Radio status: %s (%lu)\n", str_on_off(value), value); if (!read_ec_data(priv->adev->handle, VPCCMD_R_WIFI, &value)) - seq_printf(s, "Wifi status: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "Wifi status: %s (%lu)\n", str_on_off(value), value); if (!read_ec_data(priv->adev->handle, VPCCMD_R_BT, &value)) - seq_printf(s, "BT status: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "BT status: %s (%lu)\n", str_on_off(value), value); if (!read_ec_data(priv->adev->handle, VPCCMD_R_3G, &value)) - seq_printf(s, "3G status: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "3G status: %s (%lu)\n", str_on_off(value), value); seq_puts(s, "=====================\n"); if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) - seq_printf(s, "Touchpad status: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "Touchpad status: %s (%lu)\n", str_on_off(value), value); if (!read_ec_data(priv->adev->handle, VPCCMD_R_CAMERA, &value)) - seq_printf(s, "Camera status: %s (%lu)\n", value ? "on" : "off", value); + seq_printf(s, "Camera status: %s (%lu)\n", str_on_off(value), value); seq_puts(s, "=====================\n"); |
