Skip to content

Commit 97f4b99

Browse files
committed
genirq: Use scoped_guard() to shut clang up
This code pattern trips clang up: if (fail) goto undo; guard(lock)(lock); do_stuff(); return 0; undo: ... as it somehow extends the scope of the guard beyond the return statement. Replace it with a scoped guard to help it to get its act together. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Closes: https://lore.kernel.org/oe-kbuild-all/202505071809.ajpPxfoZ-lkp@intel.com/
1 parent aefc115 commit 97f4b99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/irq/manage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,8 +2564,8 @@ int request_percpu_nmi(unsigned int irq, irq_handler_t handler,
25642564
if (retval)
25652565
goto err_irq_setup;
25662566

2567-
guard(raw_spinlock_irqsave)(&desc->lock);
2568-
desc->istate |= IRQS_NMI;
2567+
scoped_guard(raw_spinlock_irqsave, &desc->lock)
2568+
desc->istate |= IRQS_NMI;
25692569
return 0;
25702570

25712571
err_irq_setup:

0 commit comments

Comments
 (0)