mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hannes Eder <hannes@hanneseder.net>
To: netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 8/8] wanrouter: fix sparse warnings: context imbalance
Date: Wed, 25 Feb 2009 21:33:06 +0100	[thread overview]
Message-ID: <20090225203301.6251.49315.stgit@vmbox.hanneseder.net> (raw)
In-Reply-To: <20090225203012.6251.32002.stgit@vmbox.hanneseder.net>

Impact: Attribute functions with __acquires(...) resp. __releases(...).

Fix this sparse warnings:
  net/wanrouter/wanproc.c:82:13: warning: context imbalance in 'r_start' - wrong count at exit
  net/wanrouter/wanproc.c:103:13: warning: context imbalance in 'r_stop' - unexpected unlock
  net/wanrouter/wanmain.c:765:13: warning: context imbalance in 'lock_adapter_irq' - wrong count at exit
  net/wanrouter/wanmain.c:771:13: warning: context imbalance in 'unlock_adapter_irq' - unexpected unlock

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
 net/wanrouter/wanmain.c |    8 ++++++--
 net/wanrouter/wanproc.c |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 39701de..466e2d2 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -86,8 +86,10 @@ static int wanrouter_device_del_if(struct wan_device *wandev,
 
 static struct wan_device *wanrouter_find_device(char *name);
 static int wanrouter_delete_interface(struct wan_device *wandev, char *name);
-static void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
-static void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
+static void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
+	__acquires(lock);
+static void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
+	__releases(lock);
 
 
 
@@ -763,12 +765,14 @@ static int wanrouter_delete_interface(struct wan_device *wandev, char *name)
 }
 
 static void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
+	__acquires(lock)
 {
 	spin_lock_irqsave(lock, *smp_flags);
 }
 
 
 static void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags)
+	__releases(lock)
 {
 	spin_unlock_irqrestore(lock, *smp_flags);
 }
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c
index 267f7ff..c44d96b 100644
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -80,6 +80,7 @@ static struct proc_dir_entry *proc_router;
  *	Iterator
  */
 static void *r_start(struct seq_file *m, loff_t *pos)
+	__acquires(kernel_lock)
 {
 	struct wan_device *wandev;
 	loff_t l = *pos;
@@ -101,6 +102,7 @@ static void *r_next(struct seq_file *m, void *v, loff_t *pos)
 }
 
 static void r_stop(struct seq_file *m, void *v)
+	__releases(kernel_lock)
 {
 	unlock_kernel();
 }


  parent reply	other threads:[~2009-02-25 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 20:31 [PATCH 0/8] net: fix (sparse) warnings Hannes Eder
2009-02-25 20:31 ` [PATCH 1/8] net/802: fix sparse warnings: context imbalance Hannes Eder
2009-02-25 20:31 ` [PATCH 2/8] 9p: fix sparse warning: cast adds address space Hannes Eder
2009-02-25 20:31 ` [PATCH 3/8] appletalk: fix warning: format not a string literal and no Hannes Eder
2009-02-25 20:32 ` [PATCH 4/8] [NET] sysctl: fix sparse warning: Should it be static? Hannes Eder
2009-02-25 20:32 ` [PATCH 5/8] decnet: fix sparse warnings: context imbalance Hannes Eder
2009-02-25 20:32 ` [PATCH 6/8] decnet: fix sparse warnings: symbol shadows an earlier one Hannes Eder
2009-02-25 20:32 ` [PATCH 7/8] inet fragments: fix sparse warning: context imbalance Hannes Eder
2009-02-25 20:33 ` Hannes Eder [this message]
2009-02-27  7:13 ` [PATCH 0/8] net: fix (sparse) warnings David Miller

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=20090225203301.6251.49315.stgit@vmbox.hanneseder.net \
    --to=hannes@hanneseder.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.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®