mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: core: Use str_true_false() helper in UFS_FLAG()
@ 2025-07-21 12:01 liu.xuemei1
  2025-07-22  3:19 ` Peter Wang (王信友)
  2025-07-25  2:04 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: liu.xuemei1 @ 2025-07-21 12:01 UTC (permalink / raw)
  To: james.bottomley, martin.petersen
  Cc: alim.akhtar, avri.altman, bvanassche, huobean, peter.wang,
	tanghuan, liu.song13, viro, quic_nguyenb, linux-scsi,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-25  2:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-21 12:01 [PATCH] scsi: ufs: core: Use str_true_false() helper in UFS_FLAG() liu.xuemei1
2025-07-22  3:19 ` Peter Wang (王信友)
2025-07-25  2:04 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®