lkml.org 
[lkml]   [2013]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] irq: add lock annotation to squelch a sparse warning
Date
__irq_put_desc_unlock() releases &desc->lock, but being a static
analyzer, sparse emits a warning:

context imbalance in '__irq_put_desc_unlock' - unexpected unlock

Help it by annotating the function with a __release. Do not annotate
its counterpart which acquires the lock, __irq_get_desc_lock(), because
it does so conditionally.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ramkumar Ramachandra <artagnon@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 192a302..d6bc26a 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -449,6 +449,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)
--
1.8.3.2.733.gf8abaeb


\
 
 \ /
  Last update: 2013-07-06 15:01    [W:1.958 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site