Thread (4 messages) 4 messages, 4 authors, 2025-03-05
STALE511d

[PATCH net-next] ionic: Simplify maximum determination in ionic_adminq_napi()

From: Markus Elfring <hidden>
Date: 2025-03-01 10:18:36
Also in: kernel-janitors, lkml
Subsystem: networking drivers, pensando ethernet drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Brett Creeley, Linus Torvalds

From: Markus Elfring <redacted>
Date: Sat, 1 Mar 2025 11:01:28 +0100

Reduce nested max() calls by a single max3() call in this
function implementation.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 7707a9e53c43..85c4b02bd054 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1242,7 +1242,7 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget)
 	if (lif->hwstamp_txq)
 		tx_work = ionic_tx_cq_service(&lif->hwstamp_txq->cq, budget, !!budget);

-	work_done = max(max(n_work, a_work), max(rx_work, tx_work));
+	work_done = max3(n_work, a_work, max(rx_work, tx_work));
 	if (work_done < budget && napi_complete_done(napi, work_done)) {
 		flags |= IONIC_INTR_CRED_UNMASK;
 		intr->rearm_count++;
--
2.48.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help