linux-scsi.vger.kernel.org archive mirror
 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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: ufs: core: Use str_true_false() helper in UFS_FLAG()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Wang (王信友) @ 2025-07-22  3:19 UTC (permalink / raw)
  To: liu.xuemei1@zte.com.cn, james.bottomley@hansenpartnership.com,
	martin.petersen@oracle.com
  Cc: huobean@gmail.com, avri.altman@wdc.com, tanghuan@vivo.com,
	quic_nguyenb@quicinc.com, linux-scsi@vger.kernel.org,
	liu.song13@zte.com.cn, bvanassche@acm.org,
	alim.akhtar@samsung.com, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org

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>



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

* Re: [PATCH] scsi: ufs: core: Use str_true_false() helper in UFS_FLAG()
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-07-25  2:04 UTC (permalink / raw)
  To: liu.xuemei1
  Cc: james.bottomley, martin.petersen, alim.akhtar, avri.altman,
	bvanassche, huobean, peter.wang, tanghuan, liu.song13, viro,
	quic_nguyenb, linux-scsi, linux-kernel


> Remove hard-coded strings by using the str_true_false() helper
> function.

Applied to 6.17/scsi-staging, thanks!

-- 
Martin K. Petersen

^ 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;
as well as URLs for NNTP newsgroup(s).