drivers/ufs/core/ufs-sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
From: Liu Song <liu.song13@zte.com.cn>
Remove hard-coded strings by using the str_true_false() helper function.
Signed-off-by: Liu Song <liu.song13@zte.com.cn>
---
drivers/ufs/core/ufs-sysfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-sysfs.c
index 00948378a719..4bd7d491e3c5 100644
--- a/drivers/ufs/core/ufs-sysfs.c
+++ b/drivers/ufs/core/ufs-sysfs.c
@@ -5,6 +5,7 @@
#include <linux/string.h>
#include <linux/bitfield.h>
#include <linux/unaligned.h>
+#include <linux/string_choices.h>
#include <ufs/ufs.h>
#include <ufs/unipro.h>
@@ -1516,7 +1517,7 @@ static ssize_t _name##_show(struct device *dev, \
ret = -EINVAL; \
goto out; \
} \
- ret = sysfs_emit(buf, "%s\n", flag ? "true" : "false"); \
+ ret = sysfs_emit(buf, "%s\n", str_true_false(flag)); \
out: \
up(&hba->host_sem); \
return ret; \
--
2.27.0
> Remove hard-coded strings by using the str_true_false() helper > function. Applied to 6.17/scsi-staging, thanks! -- Martin K. Petersen
On Mon, 2025-07-21 at 20:01 +0800, liu.xuemei1@zte.com.cn wrote: > > @@ -1516,7 +1517,7 @@ static ssize_t _name##_show(struct device > *dev, \ > ret = - > EINVAL; \ > goto > out; \ > > } \ > - ret = sysfs_emit(buf, "%s\n", flag ? "true" : > "false"); \ > + ret = sysfs_emit(buf, "%s\n", > str_true_false(flag)); \ > out: > \ > up(&hba- > >host_sem); \ > return > ret; \ > -- > 2.27.0 Reviewed-by: Peter Wang <peter.wang@mediatek.com>
© 2016 - 2025 Red Hat, Inc.