wanrouter: fix sparse warnings: context imbalance
authorHannes Eder <hannes@hanneseder.net>
Wed, 25 Feb 2009 10:33:06 +0000 (10:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Feb 2009 07:13:36 +0000 (23:13 -0800)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/wanrouter/wanmain.c
net/wanrouter/wanproc.c

index 39701dec1dbae7c400cfcfcf72ad471d489eb776..466e2d22d256de7151551575607999ff6f1e95a9 100644 (file)
@@ -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);
 }
index 267f7ff498270e3f397430d20f72cf151fb2217e..c44d96b3a437a6019ba254b99877cc7ee025f765 100644 (file)
@@ -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();
 }