Drivers:staging:ozwpan Fixed sparse context imbalance warning
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
@@ -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
Greg KH
maintainerQuoted 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 exitdrivers/staging/ozwpan/ozproto.c:802:6: warning: context imbalance in 'oz_polling_unlock_bh' - unexpected unlock so added__acquires()and__releases().Signed-off-by Surendra Patil <[email protected]>--- drivers/staging/ozwpan/ozproto.c | 2 ++ 1 file changed, 2 insertions(+)drivers/staging/ozwpan/ozproto.c +0
-0@@ -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