Skip to contentSkip to conversation

irq: Add missing annotation for __irq_put_desc_unlock()

PATCH Applied Jules Irenge 1 participant 1 message Jan 20, 2020 IRQ

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 irq: Add missing annotation for __irq_put_desc_unlock()

Sparse reports a warning at __irq_put_desc_unlock()

|warning: context imbalance in __irq_put_desc_unlock() - unexpected unlock.

To fix this, a __releases(&desc->lock) annotation is added. Given that __irq_put_desc_unlock() does actually call raw_spin_unlock_irqrestore(&desc->lock, flags) This not only fixes the warning
but also improves on readability of the code.

---
 kernel/irq/irqdesc.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
index 5b8fdd659e54..98a5f10d1900 100644
@@ -891,6 +891,7 @@ __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
 }
 
 void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
+	__releases(&desc->lock)
 {
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	if (bus)
Signature · 1 line
2.24.1