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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240514130915.2613753-1-ruanjinjie@huawei.com>
Date: Tue, 14 May 2024 21:09:15 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <tglx@...utronix.de>, <linux-kernel@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH] genirq: Clean code for handle_edge_irq()

The pending set and mask_ack_irq() repeated twice, a new goto label can
reduce a few lines of code, with no functional changes.

Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
 kernel/irq/chip.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 638cf5eee04b..4613dc9ff6b6 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -775,21 +775,15 @@ void handle_edge_irq(struct irq_desc *desc)
 
 	desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
 
-	if (!irq_may_run(desc)) {
-		desc->istate |= IRQS_PENDING;
-		mask_ack_irq(desc);
-		goto out_unlock;
-	}
+	if (!irq_may_run(desc))
+		goto out_mask_ack;
 
 	/*
 	 * If its disabled or no action available then mask it and get
 	 * out of here.
 	 */
-	if (irqd_irq_disabled(&desc->irq_data) || !desc->action) {
-		desc->istate |= IRQS_PENDING;
-		mask_ack_irq(desc);
-		goto out_unlock;
-	}
+	if (irqd_irq_disabled(&desc->irq_data) || !desc->action)
+		goto out_mask_ack;
 
 	kstat_incr_irqs_this_cpu(desc);
 
@@ -818,6 +812,9 @@ void handle_edge_irq(struct irq_desc *desc)
 	} while ((desc->istate & IRQS_PENDING) &&
 		 !irqd_irq_disabled(&desc->irq_data));
 
+out_mask_ack:
+	desc->istate |= IRQS_PENDING;
+	mask_ack_irq(desc);
 out_unlock:
 	raw_spin_unlock(&desc->lock);
 }
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ