]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: core: Use str_true_false() helper in UFS_FLAG()
authorLiu Song <liu.song13@zte.com.cn>
Mon, 21 Jul 2025 12:01:38 +0000 (20:01 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Jul 2025 02:03:41 +0000 (22:03 -0400)
Remove hard-coded strings by using the str_true_false() helper function.

Signed-off-by: Liu Song <liu.song13@zte.com.cn>
Link: https://lore.kernel.org/r/20250721200138431dOU9KyajGyGi5339ma26p@zte.com.cn
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufs-sysfs.c

index 10006ae5ee359d496f7445101e35c3070877cd81..11566afd565787df7a76aac0693b4b3bb1a7cb09 100644 (file)
@@ -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;                                                     \