* [PATCH] scsi: ufs: ufshcd: use str_enabled_disabled() for Write Booster messages
@ 2026-07-01 17:51 Animesh Rai
2026-07-06 14:10 ` Bart Van Assche
0 siblings, 1 reply; 2+ messages in thread
From: Animesh Rai @ 2026-07-01 17:51 UTC (permalink / raw)
To: James.Bottomley, martin.petersen
Cc: alim.akhtar, avri.altman, bvanassche, linux-scsi, linux-kernel,
Animesh Rai
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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-06 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 17:51 [PATCH] scsi: ufs: ufshcd: use str_enabled_disabled() for Write Booster messages Animesh Rai
2026-07-06 14:10 ` Bart Van Assche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.