Skip to contentSkip to conversation

Drivers:staging:ozwpan Fixed sparse context imbalance warning

PATCH In review Surendra Patil 2 participants 2 messages Feb 28, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers:staging:ozwpan Fixed sparse context imbalance warning

Sparse warns about -
drivers/staging/ozwpan/ozproto.c:797:6: warning: context imbalance in 'oz_polling_lock_bh' - wrong count at exit drivers/staging/ozwpan/ozproto.c:802:6: warning: context imbalance in 'oz_polling_unlock_bh' - unexpected unlock so added __acquires() and __releases().

---
 drivers/staging/ozwpan/ozproto.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/ozwpan/ozproto.c +2 -0
index e7138ed..b47cec1 100644
@@ -795,11 +795,13 @@ int oz_get_pd_list(struct oz_mac_addr *addr, int max_count)
 }
 
 void oz_polling_lock_bh(void)
+__acquires(&g_polling_block)
 {
 	spin_lock_bh(&g_polling_lock);
 }
 
 void oz_polling_unlock_bh(void)
+__releases(&g_polling_block)
 {
 	spin_unlock_bh(&g_polling_lock);
 }
Signature · 1 line
1.8.3.2
maintainer
#1 lore raw
Quoted 18 lines · Surendra Patil

Sparse warns about -
drivers/staging/ozwpan/ozproto.c:797:6: warning: context imbalance in 'oz_polling_lock_bh' - wrong count at exit drivers/staging/ozwpan/ozproto.c:802:6: warning: context imbalance in 'oz_polling_unlock_bh' - unexpected unlock so added __acquires() and __releases().

---
 drivers/staging/ozwpan/ozproto.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/ozwpan/ozproto.c +0 -0
index e7138ed..b47cec1 100644
@@ -795,11 +795,13 @@ int oz_get_pd_list(struct oz_mac_addr *addr, int max_count)
 }
 
 void oz_polling_lock_bh(void)

drivers/staging/ozwpan/ozproto.c int oz_get_pd_list(struct oz_mac_addr *addr, int max_count) · line 807

Quoted 10 lines
drivers/staging/ozwpan/ozproto.c +2 -0
+__acquires(&g_polling_block)
 {
 	spin_lock_bh(&g_polling_lock);
 }
 
 void oz_polling_unlock_bh(void)
+__releases(&g_polling_block)
 {
 	spin_unlock_bh(&g_polling_lock);
 }

How about ripping out this "wrapper" function entirely and replacing all calls to them with the "real" call to the spinlock function?

thanks,

greg k-h