Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: starfive: add lock annotations to fix context imbalances

Add the necessary __acquires() and __releases() to the functions
that take and release the wdt lock to avoid the following sparse
warnings:

drivers/watchdog/starfive-wdt.c:204:13: warning: context imbalance in 'starfive_wdt_unlock' - wrong count at exit
drivers/watchdog/starfive-wdt.c:212:9: warning: context imbalance in 'starfive_wdt_lock' - unexpected unlock

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231122085118.177589-1-ben.dooks@codethink.co.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Ben Dooks and committed by
Wim Van Sebroeck
f7799988 137c9e08

+2
+2
drivers/watchdog/starfive-wdt.c
··· 202 202 203 203 /* Write unlock-key to unlock. Write other value to lock. */ 204 204 static void starfive_wdt_unlock(struct starfive_wdt *wdt) 205 + __acquires(&wdt->lock) 205 206 { 206 207 spin_lock(&wdt->lock); 207 208 writel(wdt->variant->unlock_key, wdt->base + wdt->variant->unlock); 208 209 } 209 210 210 211 static void starfive_wdt_lock(struct starfive_wdt *wdt) 212 + __releases(&wdt->lock) 211 213 { 212 214 writel(~wdt->variant->unlock_key, wdt->base + wdt->variant->unlock); 213 215 spin_unlock(&wdt->lock);