[tip: irq/core] genirq/manage: Rework __disable_irq_nosync()

tip-bot2 for Thomas Gleixner
2025-05-07T09:07:28Z

The following commit has been merged into the irq/core branch of tip:

Commit-ID: 1b74444467240d9ff11cf109efdfb2af2f0b60c7
Gitweb: https://git.kernel.org/tip/1b74444467240d9ff11cf109efdfb2af2f0b60c7
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 29 Apr 2025 08:55:37 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 07 May 2025 09:08:15 +02:00

genirq/manage: Rework __disable_irq_nosync()

Use the new guards to get and lock the interrupt descriptor and tidy up the
code.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20250429065422.013088277@linutronix.de

---
kernel/irq/manage.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c18440d..edc8118 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -659,14 +659,11 @@ void __disable_irq(struct irq_desc *desc)

static int __disable_irq_nosync(unsigned int irq)
{
- unsigned long flags;
- struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
-
- if (!desc)
- return -EINVAL;
- __disable_irq(desc);
- irq_put_desc_busunlock(desc, flags);
- return 0;
+ scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_GLOBAL) {
+ __disable_irq(scoped_irqdesc);
+ return 0;
+ }
+ return -EINVAL;
}

/**