[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1646623519-30588-1-git-send-email-baihaowen88@gmail.com>
Date: Mon, 7 Mar 2022 11:25:19 +0800
From: Haowen Bai <baihaowen88@...il.com>
To: peppe.cavallaro@...com, alexandre.torgue@...s.st.com,
joabreu@...opsys.com, davem@...emloft.net, kuba@...nel.org
Cc: netdev@...r.kernel.org, Haowen Bai <baihaowen88@...il.com>
Subject: [PATCH] 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()
Signed-off-by: Haowen Bai <baihaowen88@...il.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 422e322..5989875 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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)];
--
2.7.4
Powered by blists - more mailing lists