* [PATCH] amd-xgbe: use str_yes_no() helper in xgbe_get_all_hw_features()
@ 2026-09-18 13:32 Lalit Shankar Chowdhury
2026-09-18 22:08 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Lalit Shankar Chowdhury @ 2026-09-18 13:32 UTC (permalink / raw)
To: Raju Rangoju, Prashanth Kumar K R, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni,
open list:AMD XGBE DRIVER, open list
Cc: Lalit Shankar Chowdhury
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] amd-xgbe: use str_yes_no() helper in xgbe_get_all_hw_features()
2026-09-18 13:32 [PATCH] amd-xgbe: use str_yes_no() helper in xgbe_get_all_hw_features() Lalit Shankar Chowdhury
@ 2026-09-18 22:08 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-09-18 22:08 UTC (permalink / raw)
To: Lalit Shankar Chowdhury
Cc: Raju Rangoju, Prashanth Kumar K R, Andrew Lunn, David S. Miller,
Eric Dumazet, Paolo Abeni, open list:AMD XGBE DRIVER, open list
On Fri, 18 Sep 2026 13:32:18 +0000 Lalit Shankar Chowdhury wrote:
> Prefer the str_yes_no() helper
We don't prefer these in networking
They provide no value and just lead to waste-of-time conversion patches
--
pw-bot: reject
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-18 22:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 13:32 [PATCH] amd-xgbe: use str_yes_no() helper in xgbe_get_all_hw_features() Lalit Shankar Chowdhury
2026-09-18 22:08 ` Jakub Kicinski
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®