]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
genirq: Use scoped_guard() to shut clang up
authorThomas Gleixner <tglx@linutronix.de>
Wed, 7 May 2025 13:47:06 +0000 (15:47 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 May 2025 15:08:44 +0000 (17:08 +0200)
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/
kernel/irq/manage.c

index e6c6c0a2dc9c465ce22112a59171702dcba7caec..2861e11acf3a0005f36885a9732265fb6a05af12 100644 (file)
@@ -2564,8 +2564,8 @@ int request_percpu_nmi(unsigned int irq, irq_handler_t handler,
        if (retval)
                goto err_irq_setup;
 
-       guard(raw_spinlock_irqsave)(&desc->lock);
-       desc->istate |= IRQS_NMI;
+       scoped_guard(raw_spinlock_irqsave, &desc->lock)
+               desc->istate |= IRQS_NMI;
        return 0;
 
 err_irq_setup: