lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR05MB41101B1316E8332D86EE7988DA6F0@VI1PR05MB4110.eurprd05.prod.outlook.com>
Date:   Tue, 30 Jun 2020 14:18:59 +0000
From:   Asmaa Mnebhi <Asmaa@...lanox.com>
To:     Lee Jones <lee.jones@...aro.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "bgolaszewski@...libre.com" <bgolaszewski@...libre.com>
CC:     "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>
Subject: RE: [PATCH 10/10] gpio: gpio-mlxbf2.c: Provide __releases()
 annotation to stop confusing Sparse

Reviewed-by: Asmaa Mnebhi <asmaa@...lanox.com>

Thank you.

-----Original Message-----
From: Lee Jones <lee.jones@...aro.org> 
Sent: Tuesday, June 30, 2020 9:34 AM
To: linus.walleij@...aro.org; bgolaszewski@...libre.com
Cc: linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org; linux-gpio@...r.kernel.org; Lee Jones <lee.jones@...aro.org>; Asmaa Mnebhi <Asmaa@...lanox.com>
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 <Asmaa@...lanox.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
 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)
 {
 	writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io);
 	spin_unlock(&gs->gc.bgpio_lock);
--
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ