linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] irq: Add  missing annotation for __irq_put_desc_unlock()
@ 2020-01-20 22:37 Jules Irenge
  0 siblings, 0 replies; only message in thread
From: Jules Irenge @ 2020-01-20 22:37 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, boqun.feng, Jules Irenge

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.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 kernel/irq/irqdesc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 5b8fdd659e54..98a5f10d1900 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -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)
-- 
2.24.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-20 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 22:37 [PATCH 1/5] irq: Add missing annotation for __irq_put_desc_unlock() Jules Irenge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).