From: Ramkumar Ramachandra <artagnon@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Yinghai Lu <yinghai@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 2/3] apic: add lock annotations to squelch sparse warnings
Date: Sat, 6 Jul 2013 17:41:25 +0530 [thread overview]
Message-ID: <1373112686-28501-3-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1373112686-28501-1-git-send-email-artagnon@gmail.com>
sparse, being a static analyzer, emits the following warnings:
context imbalance in 'lock_vector_lock' - wrong count at exit
context imbalance in 'unlock_vector_lock' - unexpected unlock
Help it by annotating the pair of functions with __acquires and
__releases.
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
arch/x86/kernel/apic/io_apic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 9ed796c..b756417 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1061,6 +1061,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
void lock_vector_lock(void)
+ __acquires(&vector_lock)
{
/* Used to the online set of cpus does not change
* during assign_irq_vector.
@@ -1069,6 +1070,7 @@ void lock_vector_lock(void)
}
void unlock_vector_lock(void)
+ __releases(&vector_lock)
{
raw_spin_unlock(&vector_lock);
}
--
1.8.3.2.733.gf8abaeb
next prev parent reply other threads:[~2013-07-06 12:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-06 12:11 [PATCH 0/3] Trivial sparse acquire/release annotations Ramkumar Ramachandra
2013-07-06 12:11 ` [PATCH 1/3] nfs: add lock annotations to squelch sparse warnings Ramkumar Ramachandra
2013-07-06 12:11 ` Ramkumar Ramachandra [this message]
2013-07-06 12:11 ` [PATCH 3/3] irq: add lock annotation to squelch a sparse warning Ramkumar Ramachandra
2013-09-23 14:41 ` [PATCH 0/3] Trivial sparse acquire/release annotations Ramkumar Ramachandra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373112686-28501-3-git-send-email-artagnon@gmail.com \
--to=artagnon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®