diff mbox series

[9/9] power: wakeup: Add missing annotation for wakeup_sources_read_lock() and wakeup_sources_read_unlock()

Message ID 20200411001933.10072-10-jbi.octave@gmail.com (mailing list archive)
State Changes Requested, archived
Delegated to: Rafael Wysocki
Headers show
Series None | expand

Commit Message

Jules Irenge April 11, 2020, 12:19 a.m. UTC
Sparse reports warnings at wakeup_sources_read_lock()
	and wakeup_sources_read_unlock()

warning: context imbalance in wakeup_sources_read_lock()
	- wrong count at exit
context imbalance in wakeup_sources_read_unlock()
	- unexpected unlock

The root cause is the missing annotation at
wakeup_sources_read_lock() and wakeup_sources_read_unlock()

Add the missing  __acquires(&wakeup_srcu) annotation
Add the missing __releases(&wakeup_srcu) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/base/power/wakeup.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 41ce086d8f57..753e9a46e04e 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -254,6 +254,7 @@  EXPORT_SYMBOL_GPL(wakeup_source_unregister);
  * This index must be passed to the matching wakeup_sources_read_unlock().
  */
 int wakeup_sources_read_lock(void)
+	__acquires(&wakeup_srcu)
 {
 	return srcu_read_lock(&wakeup_srcu);
 }
@@ -264,6 +265,7 @@  EXPORT_SYMBOL_GPL(wakeup_sources_read_lock);
  * @idx: return value from corresponding wakeup_sources_read_lock()
  */
 void wakeup_sources_read_unlock(int idx)
+	__releases(&wakeup_srcu)
 {
 	srcu_read_unlock(&wakeup_srcu, idx);
 }