[PATCH] scsi: qla2xxx: Use str_true_false() helper in qla2x00_allow_cna_fw_dump_show()

liu.xuemei1@zte.com.cn posted 1 patch 2 months, 2 weeks ago
drivers/scsi/qla2xxx/qla_attr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] scsi: qla2xxx: Use str_true_false() helper in qla2x00_allow_cna_fw_dump_show()
Posted by liu.xuemei1@zte.com.cn 2 months, 2 weeks ago
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/scsi/qla2xxx/qla_attr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 2e584a8bf66b..e58658ade770 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -10,6 +10,7 @@
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/string_choices.h>

 static int qla24xx_vport_disable(struct fc_vport *, bool);

@@ -1722,7 +1723,7 @@ qla2x00_allow_cna_fw_dump_show(struct device *dev,
 		return scnprintf(buf, PAGE_SIZE, "\n");
 	else
 		return scnprintf(buf, PAGE_SIZE, "%s\n",
-		    vha->hw->allow_cna_fw_dump ? "true" : "false");
+		    str_true_false(vha->hw->allow_cna_fw_dump));
 }

 static ssize_t
-- 
2.27.0