Skip to contentSkip to conversation

net: stmmac: Use max() instead of doing it manually

PATCH New Haowen Bai 1 participant 1 message Mar 7, 2022

Subsystems (4)
lore
Share & tools
lore

Haowen Bai

author
#0 lore raw

PATCH v2 1/1 net: stmmac: Use max() instead of doing it manually

Fix following coccicheck warning:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:2806:42-43: WARNING opportunity for max()

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -2
index 422e322..5989875 100644
@@ -2803,8 +2803,8 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)
 {
 	u32 tx_channel_count = priv->plat->tx_queues_to_use;
 	u32 rx_channel_count = priv->plat->rx_queues_to_use;
-	u32 channels_to_check = tx_channel_count > rx_channel_count ?
-				tx_channel_count : rx_channel_count;
+	u32 channels_to_check = max(tx_channel_count, rx_channel_count);
 	u32 chan;
 	int status[max_t(u32, MTL_MAX_TX_QUEUES, MTL_MAX_RX_QUEUES)];
 
Signature · 1 line
2.7.4