lkml.org 
[lkml]   [2020]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 8/9] power: wakeup: Add missing annotation for wakeup_sources_stats_seq_start() and wakeup_sources_stats_seq_stop()
Date
Sparse reports warnings at wakeup_sources_stats_seq_start()
and wakeup_sources_stats_seq_stop()

warning: context imbalance in wakeup_sources_stats_seq_start()
- wrong count at exit
context imbalance in wakeup_sources_stats_seq_stop()
- unexpected unlock

The root cause is the missing annotation at
wakeup_sources_stats_seq_start() and wakeup_sources_stats_seq_stop()

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 --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 27f3e60608e5..41ce086d8f57 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -1092,6 +1092,7 @@ static int print_wakeup_source_stats(struct seq_file *m,

static void *wakeup_sources_stats_seq_start(struct seq_file *m,
loff_t *pos)
+ __acquires(&wakeup_srcu)
{
struct wakeup_source *ws;
loff_t n = *pos;
@@ -1132,6 +1133,7 @@ static void *wakeup_sources_stats_seq_next(struct seq_file *m,
}

static void wakeup_sources_stats_seq_stop(struct seq_file *m, void *v)
+ __releases(&wakeup_srcu)
{
int *srcuidx = m->private;

--
2.24.1
\
 
 \ /
  Last update: 2020-04-11 02:21    [W:0.641 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site