[PATCH 19/30] driver core: Add missing annotation for device_links_read_lock()
From: Jules Irenge
Date: Fri Feb 14 2020 - 15:49:08 EST
Sparse reports a warning at device_links_read_unlock()
warning: warning: context imbalance in device_links_read_unlock()
- unexpected unlock
The root cause is the missing annotation at device_links_read_unlock()
Add the missing __releases(&device_links_srcu) annotation
Signed-off-by: Jules Irenge <jbi.octave@xxxxxxxxx>
---
drivers/base/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index fc7f1b8746da..3a7e72840740 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -69,7 +69,7 @@ int device_links_read_lock(void) __acquires(&device_links_srcu)
return srcu_read_lock(&device_links_srcu);
}
-void device_links_read_unlock(int idx)
+void device_links_read_unlock(int idx) __releases(&device_links_srcu)
{
srcu_read_unlock(&device_links_srcu, idx);
}
--
2.24.1