lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <cbbc2dbd-2028-4623-8cb3-9d01be341daa@web.de>
Date: Sat, 1 Mar 2025 11:12:31 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
 Brett Creeley <brett.creeley@....com>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jacob Keller <jacob.e.keller@...el.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Shannon Nelson <shannon.nelson@....com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Qasim Ijaz <qasdev00@...il.com>, Natalie Vock <natalie.vock@....de>
Subject: [PATCH net-next] ionic: Simplify maximum determination in
 ionic_adminq_napi()

From: Markus Elfring <elfring@...rs.sourceforge.net>
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 <elfring@...rs.sourceforge.net>
---
 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ