public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: use str_enabled_disabled() for digest mismatch messages
@ 2026-05-04 12:35 Rohit Chavan
  0 siblings, 0 replies; only message in thread
From: Rohit Chavan @ 2026-05-04 12:35 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi; +Cc: linux-nvme, linux-kernel, Rohit Chavan

Replace open-coded ternary expressions with str_enabled_disabled()
when printing data and header digest mismatch messages in
nvme_tcp_init_connection().

This makes the code more readable and consistent with existing
helpers used for boolean string representation.

No functional change intended.

Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
---
 drivers/nvme/host/tcp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 243dab830dc8..b3165cd79a31 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -8,6 +8,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/string_choices.h>
 #include <linux/crc32.h>
 #include <linux/nvme-tcp.h>
 #include <linux/nvme-keyring.h>
@@ -1550,8 +1551,8 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue)
 	    (!queue->data_digest && ctrl_ddgst)) {
 		pr_err("queue %d: data digest mismatch host: %s ctrl: %s\n",
 			nvme_tcp_queue_id(queue),
-			queue->data_digest ? "enabled" : "disabled",
-			ctrl_ddgst ? "enabled" : "disabled");
+			str_enabled_disabled(queue->data_digest),
+			str_enabled_disabled(ctrl_ddgst));
 		goto free_icresp;
 	}
 
@@ -1560,8 +1561,8 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue)
 	    (!queue->hdr_digest && ctrl_hdgst)) {
 		pr_err("queue %d: header digest mismatch host: %s ctrl: %s\n",
 			nvme_tcp_queue_id(queue),
-			queue->hdr_digest ? "enabled" : "disabled",
-			ctrl_hdgst ? "enabled" : "disabled");
+			str_enabled_disabled(queue->hdr_digest),
+			str_enabled_disabled(ctrl_hdgst);
 		goto free_icresp;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-04 12:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 12:35 [PATCH] nvme: use str_enabled_disabled() for digest mismatch messages Rohit Chavan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox