From: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
To: Raju Rangoju <Raju.Rangoju@amd.com>,
Prashanth Kumar K R <PrashanthKumar.K.R@amd.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org (open list:AMD XGBE DRIVER),
linux-kernel@vger.kernel.org (open list)
Cc: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
Subject: [PATCH] amd-xgbe: use str_yes_no() helper in xgbe_get_all_hw_features()
Date: Fri, 18 Sep 2026 13:32:18 +0000 [thread overview]
Message-ID: <20260918133218.39778-1-lalitshankarch@gmail.com> (raw)
Prefer the str_yes_no() helper function over ternary operators
with hardcoded strings.
No functional change.
Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 39 ++++++++++++------------
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 2d6d00e3689b..fa7909cff75b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -14,6 +14,7 @@
#include <linux/if_ether.h>
#include <linux/net_tstamp.h>
#include <linux/phy.h>
+#include <linux/string_choices.h>
#include <net/vxlan.h>
#include "xgbe.h"
@@ -807,27 +808,27 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
/* Hardware feature register 0 */
dev_dbg(pdata->dev, " 1GbE support : %s\n",
- hw_feat->gmii ? "yes" : "no");
+ str_yes_no(hw_feat->gmii));
dev_dbg(pdata->dev, " VLAN hash filter : %s\n",
- hw_feat->vlhash ? "yes" : "no");
+ str_yes_no(hw_feat->vlhash));
dev_dbg(pdata->dev, " MDIO interface : %s\n",
- hw_feat->sma ? "yes" : "no");
+ str_yes_no(hw_feat->sma));
dev_dbg(pdata->dev, " Wake-up packet support : %s\n",
- hw_feat->rwk ? "yes" : "no");
+ str_yes_no(hw_feat->rwk));
dev_dbg(pdata->dev, " Magic packet support : %s\n",
- hw_feat->mgk ? "yes" : "no");
+ str_yes_no(hw_feat->mgk));
dev_dbg(pdata->dev, " Management counters : %s\n",
- hw_feat->mmc ? "yes" : "no");
+ str_yes_no(hw_feat->mmc));
dev_dbg(pdata->dev, " ARP offload : %s\n",
- hw_feat->aoe ? "yes" : "no");
+ str_yes_no(hw_feat->aoe));
dev_dbg(pdata->dev, " IEEE 1588-2008 Timestamp : %s\n",
- hw_feat->ts ? "yes" : "no");
+ str_yes_no(hw_feat->ts));
dev_dbg(pdata->dev, " Energy Efficient Ethernet : %s\n",
- hw_feat->eee ? "yes" : "no");
+ str_yes_no(hw_feat->eee));
dev_dbg(pdata->dev, " TX checksum offload : %s\n",
- hw_feat->tx_coe ? "yes" : "no");
+ str_yes_no(hw_feat->tx_coe));
dev_dbg(pdata->dev, " RX checksum offload : %s\n",
- hw_feat->rx_coe ? "yes" : "no");
+ str_yes_no(hw_feat->rx_coe));
dev_dbg(pdata->dev, " Additional MAC addresses : %u\n",
hw_feat->addn_mac);
dev_dbg(pdata->dev, " Timestamp source : %s\n",
@@ -835,9 +836,9 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
(hw_feat->ts_src == 2) ? "external" :
(hw_feat->ts_src == 3) ? "internal/external" : "n/a");
dev_dbg(pdata->dev, " SA/VLAN insertion : %s\n",
- hw_feat->sa_vlan_ins ? "yes" : "no");
+ str_yes_no(hw_feat->sa_vlan_ins));
dev_dbg(pdata->dev, " VXLAN/NVGRE support : %s\n",
- hw_feat->vxn ? "yes" : "no");
+ str_yes_no(hw_feat->vxn));
/* Hardware feature register 1 */
dev_dbg(pdata->dev, " RX fifo size : %u\n",
@@ -845,19 +846,19 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
dev_dbg(pdata->dev, " TX fifo size : %u\n",
hw_feat->tx_fifo_size);
dev_dbg(pdata->dev, " IEEE 1588 high word : %s\n",
- hw_feat->adv_ts_hi ? "yes" : "no");
+ str_yes_no(hw_feat->adv_ts_hi));
dev_dbg(pdata->dev, " DMA width : %u\n",
hw_feat->dma_width);
dev_dbg(pdata->dev, " Data Center Bridging : %s\n",
- hw_feat->dcb ? "yes" : "no");
+ str_yes_no(hw_feat->dcb));
dev_dbg(pdata->dev, " Split header : %s\n",
- hw_feat->sph ? "yes" : "no");
+ str_yes_no(hw_feat->sph));
dev_dbg(pdata->dev, " TCP Segmentation Offload : %s\n",
- hw_feat->tso ? "yes" : "no");
+ str_yes_no(hw_feat->tso));
dev_dbg(pdata->dev, " Debug memory interface : %s\n",
- hw_feat->dma_debug ? "yes" : "no");
+ str_yes_no(hw_feat->dma_debug));
dev_dbg(pdata->dev, " Receive Side Scaling : %s\n",
- hw_feat->rss ? "yes" : "no");
+ str_yes_no(hw_feat->rss));
dev_dbg(pdata->dev, " Traffic Class count : %u\n",
hw_feat->tc_cnt);
dev_dbg(pdata->dev, " Hash table size : %u\n",
--
2.53.0
next reply other threads:[~2026-09-18 13:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 13:32 Lalit Shankar Chowdhury [this message]
2026-09-18 22:08 ` Jakub Kicinski
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=20260918133218.39778-1-lalitshankarch@gmail.com \
--to=lalitshankarch@gmail.com \
--cc=PrashanthKumar.K.R@amd.com \
--cc=Raju.Rangoju@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®