lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 18/30] driver core: Add missing annotation for device_links_write_lock()
Date
Sparse reports a warning at device_links_write_lock()

warning: context imbalance in evice_links_write_lock()
- wrong count at exit

The root cause is the missing annotation at device_links_write_lock()
Add the missing __acquires(&device_links_srcu) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
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 42a672456432..fc7f1b8746da 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -64,7 +64,7 @@ static inline void device_links_write_unlock(void)
mutex_unlock(&device_links_lock);
}

-int device_links_read_lock(void)
+int device_links_read_lock(void) __acquires(&device_links_srcu)
{
return srcu_read_lock(&device_links_srcu);
}
--
2.24.1
\
 
 \ /
  Last update: 2020-02-14 21:50    [W:0.113 / U:6.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site