mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jules Irenge <jbi.octave@gmail.com>
To: boqun.feng@gmail.com
Cc: peterz@infradead.org, mingo@redhat.com, will@kernel.org,
	linux-kernel@vger.kernel.org, Jules Irenge <jbi.octave@gmail.com>
Subject: [PATCH] kernel: locking: add releases(lock) annotation
Date: Mon, 16 Dec 2019 15:39:52 +0000	[thread overview]
Message-ID: <20191216153952.37038-1-jbi.octave@gmail.com> (raw)

Add releases(lock) annotation to remove issue detected by sparse tool.
warning: context imbalance in xxxxxxx() - unexpected unlock

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 kernel/locking/spinlock.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c
index 0ff08380f531..bb088fcf2be5 100644
--- a/kernel/locking/spinlock.c
+++ b/kernel/locking/spinlock.c
@@ -187,6 +187,7 @@ EXPORT_SYMBOL(_raw_spin_unlock);
 
 #ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE
 void __lockfunc _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
+	__releases(lock)
 {
 	__raw_spin_unlock_irqrestore(lock, flags);
 }
@@ -203,6 +204,7 @@ EXPORT_SYMBOL(_raw_spin_unlock_irq);
 
 #ifndef CONFIG_INLINE_SPIN_UNLOCK_BH
 void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock)
+	__releases(lock)
 {
 	__raw_spin_unlock_bh(lock);
 }
@@ -275,6 +277,7 @@ EXPORT_SYMBOL(_raw_read_unlock_irq);
 
 #ifndef CONFIG_INLINE_READ_UNLOCK_BH
 void __lockfunc _raw_read_unlock_bh(rwlock_t *lock)
+	__releases(lock)
 {
 	__raw_read_unlock_bh(lock);
 }
@@ -331,6 +334,7 @@ EXPORT_SYMBOL(_raw_write_unlock);
 
 #ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
 void __lockfunc _raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
+	__releases(lock)
 {
 	__raw_write_unlock_irqrestore(lock, flags);
 }
@@ -347,6 +351,7 @@ EXPORT_SYMBOL(_raw_write_unlock_irq);
 
 #ifndef CONFIG_INLINE_WRITE_UNLOCK_BH
 void __lockfunc _raw_write_unlock_bh(rwlock_t *lock)
+	__releases(lock)
 {
 	__raw_write_unlock_bh(lock);
 }
-- 
2.23.0


             reply	other threads:[~2019-12-16 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 15:39 Jules Irenge [this message]
2019-12-17  9:13 ` Peter Zijlstra
2020-02-06 14:59   ` Jules Irenge

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=20191216153952.37038-1-jbi.octave@gmail.com \
    --to=jbi.octave@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@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®