All of lore.kernel.org
 help / color / mirror / Atom feed
From: Animesh Rai <animeshrai853@gmail.com>
To: James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com
Cc: alim.akhtar@samsung.com, avri.altman@sandisk.com,
	bvanassche@acm.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Animesh Rai <animeshrai853@gmail.com>
Subject: [PATCH] scsi: ufs: ufshcd: use str_enabled_disabled() for Write Booster messages
Date: Wed,  1 Jul 2026 23:21:52 +0530	[thread overview]
Message-ID: <20260701175152.7446-1-animeshrai853@gmail.com> (raw)

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


             reply	other threads:[~2026-07-01 17:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 17:51 Animesh Rai [this message]
2026-07-06 14:10 ` [PATCH] scsi: ufs: ufshcd: use str_enabled_disabled() for Write Booster messages Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260701175152.7446-1-animeshrai853@gmail.com \
    --to=animeshrai853@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@sandisk.com \
    --cc=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.