From: Yumeng Fang Date: Mon, 23 Jun 2025 12:29:44 +0000 (+0800) Subject: misc: enclosure: Use str_on_off() helper X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81bfbb2d80eec19132bc1d8d0f6d26508363d813;p=thirdparty%2Fkernel%2Fstable.git misc: enclosure: Use str_on_off() helper Remove hard-coded strings by using the str_on_off() helper. Signed-off-by: Yumeng Fang Link: https://lore.kernel.org/r/20250623202944425TQzPdeMtYA8qRtlrnwiR8@zte.com.cn Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index 76511d279aff..ca4c420e4a2f 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c @@ -17,6 +17,7 @@ #include #include #include +#include static LIST_HEAD(container_list); static DEFINE_MUTEX(container_list_lock); @@ -592,7 +593,7 @@ static ssize_t get_component_power_status(struct device *cdev, if (ecomp->power_status == -1) return (edev->cb->get_power_status) ? -EIO : -ENOTTY; - return sysfs_emit(buf, "%s\n", ecomp->power_status ? "on" : "off"); + return sysfs_emit(buf, "%s\n", str_on_off(ecomp->power_status)); } static ssize_t set_component_power_status(struct device *cdev,