[PATCH] scsi: ufs: ufshcd: use str_enabled_disabled() for Write Booster messages
From: Animesh Rai
Date: Wed Jul 01 2026 - 13:53:30 EST
Replace open-coded ternary expressions of the form
enable ? "enabled" : "disabled"
with the str_enabled_disabled() helper from <linux/string_choices.h>.
This reduces code duplication and allows the linker to deduplicate the
constant strings across the kernel image.
Signed-off-by: Animesh Rai <animeshrai853@xxxxxxxxx>
---
drivers/ufs/core/ufshcd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index d3044a3089b5..e9cbed514a5c 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -26,6 +26,7 @@
#include <linux/sched/clock.h>
#include <linux/sizes.h>
#include <linux/iopoll.h>
+#include <linux/string_choices.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_driver.h>
@@ -6339,7 +6340,7 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable)
hba->dev_info.wb_enabled = enable;
dev_dbg(hba->dev, "%s: Write Booster %s\n",
- __func__, enable ? "enabled" : "disabled");
+ __func__, str_enabled_disabled(enable));
return ret;
}
@@ -6357,7 +6358,7 @@ static void ufshcd_wb_toggle_buf_flush_during_h8(struct ufs_hba *hba,
return;
}
dev_dbg(hba->dev, "%s: WB-Buf Flush during H8 %s\n",
- __func__, enable ? "enabled" : "disabled");
+ __func__, str_enabled_disabled(enable));
}
int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable)
@@ -6377,7 +6378,7 @@ int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable)
hba->dev_info.wb_buf_flush_enabled = enable;
dev_dbg(hba->dev, "%s: WB-Buf Flush %s\n",
- __func__, enable ? "enabled" : "disabled");
+ __func__, str_enabled_disabled(enable));
return ret;
}
--
2.43.0