[lkml]   [2020]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 10/10] gpio: gpio-mlxbf2.c: Provide __releases() annotation to stop confusing Sparse
Sparse cannot peer into other functions to see when and if locks are
acquired and released, thus it simply warns that a 'context imbalance'
is detected instead. Let's be kind to Sparse and let it know that
this behaviour is intentional.

drivers/gpio/gpio-mlxbf2.c:125:12: warning: context imbalance in 'mlxbf2_gpio_lock_acquire' - different lock contexts for basic block
drivers/gpio/gpio-mlxbf2.c:151:13: warning: context imbalance in 'mlxbf2_gpio_lock_release' - unexpected unlock

Cc: Asmaa Mnebhi <>
Signed-off-by: Lee Jones <>
drivers/gpio/gpio-mlxbf2.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index 861a8d0a84be0..befa5e1099439 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -149,6 +149,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
* Release the YU arm_gpio_lock after changing the direction mode.
static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs)
+ __releases(&gs->gc.bgpio_lock)
+ __releases(yu_arm_gpio_lock_param.lock)
 \ /
  Last update: 2020-06-30 15:34    [W:0.139 / U:8.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site