From: Thomas Gleixner Date: Wed, 7 May 2025 13:47:06 +0000 (+0200) Subject: genirq: Use scoped_guard() to shut clang up X-Git-Tag: v6.16-rc1~189^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97f4b999e0c894d3e48e318aa1130132031815b3;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Thomas Gleixner Closes: https://lore.kernel.org/oe-kbuild-all/202505071809.ajpPxfoZ-lkp@intel.com/ --- diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index e6c6c0a2dc9c4..2861e11acf3a0 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -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: