]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
genirq: Move NULL check into irqdesc_lock guard unlock expression
authorDmitry Ilvokhin <d@ilvokhin.com>
Tue, 2 Jun 2026 07:12:51 +0000 (07:12 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 3 Jun 2026 09:38:47 +0000 (11:38 +0200)
irqdesc_lock uses __DEFINE_UNLOCK_GUARD() directly with a custom
constructor that can set .lock to NULL.

In preparation for removing the NULL check from __DEFINE_UNLOCK_GUARD(),
move the NULL check into the irqdesc_lock unlock expression, making the
NULL handling explicit at the call site.

No functional change.

Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/ab457810653e4356e29b2d74ba616478bd9328ad.1780064327.git.d@ilvokhin.com
kernel/irq/internals.h

index 9412e57056f5cb8312ff54690a738c137dca88ee..347cb333b9feabfff14b4ef39deb04ed0546d0a4 100644 (file)
@@ -171,7 +171,7 @@ void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
 
 __DEFINE_CLASS_IS_CONDITIONAL(irqdesc_lock, true);
 __DEFINE_UNLOCK_GUARD(irqdesc_lock, struct irq_desc,
-                     __irq_put_desc_unlock(_T->lock, _T->flags, _T->bus),
+                     if (_T->lock) __irq_put_desc_unlock(_T->lock, _T->flags, _T->bus),
                      unsigned long flags; bool bus);
 
 static inline class_irqdesc_lock_t class_irqdesc_lock_constructor(unsigned int irq, bool bus,