linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] enic: use string choice helpers to simplify dev_info arguments
@ 2025-08-10 19:29 Akhilesh Patil
  2025-08-11 15:56 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Akhilesh Patil @ 2025-08-10 19:29 UTC (permalink / raw)
  To: benve, satishkh, andrew+netdev, davem, edumazet, kuba, pabeni,
	neescoba, johndale
  Cc: netdev, linux-kernel, akhileshpatilvnit, skhan

Use standard string choices helper str_yes_no() to simplify
arguments of dev_info() in enic_get_vnic_config().
Avoid hardcoded multiple use of same string constants by using
helper function achieving the same functionality.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
---
 drivers/net/ethernet/cisco/enic/enic_res.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_res.c b/drivers/net/ethernet/cisco/enic/enic_res.c
index bbd3143ed73e..a09625d47edd 100644
--- a/drivers/net/ethernet/cisco/enic/enic_res.c
+++ b/drivers/net/ethernet/cisco/enic/enic_res.c
@@ -95,11 +95,11 @@ int enic_get_vnic_config(struct enic *enic)
 	dev_info(enic_get_dev(enic), "vNIC csum tx/rx %s/%s "
 		"tso/lro %s/%s rss %s intr mode %s type %s timer %d usec "
 		"loopback tag 0x%04x\n",
-		ENIC_SETTING(enic, TXCSUM) ? "yes" : "no",
-		ENIC_SETTING(enic, RXCSUM) ? "yes" : "no",
-		ENIC_SETTING(enic, TSO) ? "yes" : "no",
-		ENIC_SETTING(enic, LRO) ? "yes" : "no",
-		ENIC_SETTING(enic, RSS) ? "yes" : "no",
+		str_yes_no(ENIC_SETTING(enic, TXCSUM)),
+		str_yes_no(ENIC_SETTING(enic, RXCSUM)),
+		str_yes_no(ENIC_SETTING(enic, TSO)),
+		str_yes_no(ENIC_SETTING(enic, LRO)),
+		str_yes_no(ENIC_SETTING(enic, RSS)),
 		c->intr_mode == VENET_INTR_MODE_INTX ? "INTx" :
 		c->intr_mode == VENET_INTR_MODE_MSI ? "MSI" :
 		c->intr_mode == VENET_INTR_MODE_ANY ? "any" :
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] enic: use string choice helpers to simplify dev_info arguments
  2025-08-10 19:29 [PATCH] enic: use string choice helpers to simplify dev_info arguments Akhilesh Patil
@ 2025-08-11 15:56 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2025-08-11 15:56 UTC (permalink / raw)
  To: Akhilesh Patil
  Cc: benve, satishkh, andrew+netdev, davem, edumazet, pabeni, neescoba,
	johndale, netdev, linux-kernel, akhileshpatilvnit, skhan

On Mon, 11 Aug 2025 00:59:25 +0530 Akhilesh Patil wrote:
> Use standard string choices helper str_yes_no() to simplify
> arguments of dev_info() in enic_get_vnic_config().
> Avoid hardcoded multiple use of same string constants by using
> helper function achieving the same functionality.

This is unnecessary noise..
-- 
pw-bot: reject

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-11 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-10 19:29 [PATCH] enic: use string choice helpers to simplify dev_info arguments Akhilesh Patil
2025-08-11 15:56 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).