[patch 1/7] genirq/generic-chip: Make locking unconditional

Thomas Gleixner
2025-03-13T14:31:17Z

The SMP conditional wrappers around raw_spin_[un]lock() have no real
value. On !SMP kernels the lock operations are NOOPs except for a
preempt_disable/enable() pair on PREEMPT enabled kernels, which are not
really worth to optimize for. Aside of that this evades lockdep on !SMP
kernels.

Remove the !SMP stubs and make it unconditional.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/irq.h | 5 -----
1 file changed, 5 deletions(-)

--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -1219,7 +1219,6 @@ static inline struct irq_chip_type *irq_

#define IRQ_MSK(n) (u32)((n) < 32 ? ((1 << (n)) - 1) : UINT_MAX)

-#ifdef CONFIG_SMP
static inline void irq_gc_lock(struct irq_chip_generic *gc)
{
raw_spin_lock(&gc->lock);
@@ -1229,10 +1228,6 @@ static inline void irq_gc_unlock(struct
{
raw_spin_unlock(&gc->lock);
}
-#else
-static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
-static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
-#endif

/*
* The irqsave variants are for usage in non interrupt code. Do not use