aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2016-07-26 18:21:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 19:19:19 -0400
commitd5dfc80f80dbb3bf94e5e9efa694670ea78cd84d (patch)
tree8eebed86fbc0b1e4ebbcf087e24c03ccb8de49c6
parent6b524995a71d49ae032dba308d117dbf2a18d175 (diff)
dma-debug: track bucket lock state for static checkers
get_hash_bucket() and put_hash_bucket() acquire and release the same spinlock, but this confuses static checkers such as sparse lib/dma-debug.c:254:27: warning: context imbalance in 'get_hash_bucket' - wrong count at exit lib/dma-debug.c:268:13: warning: context imbalance in 'put_hash_bucket' - unexpected unlock Add the appropriate acquire and release statements so that checkers can properly track the lock state. Link: http://lkml.kernel.org/r/20160701191552.24295-1-sboyd@codeaurora.org Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--lib/dma-debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 51a76af25c66..fcfa1939ac41 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -253,6 +253,7 @@ static int hash_fn(struct dma_debug_entry *entry)
253 */ 253 */
254static struct hash_bucket *get_hash_bucket(struct dma_debug_entry *entry, 254static struct hash_bucket *get_hash_bucket(struct dma_debug_entry *entry,
255 unsigned long *flags) 255 unsigned long *flags)
256 __acquires(&dma_entry_hash[idx].lock)
256{ 257{
257 int idx = hash_fn(entry); 258 int idx = hash_fn(entry);
258 unsigned long __flags; 259 unsigned long __flags;
@@ -267,6 +268,7 @@ static struct hash_bucket *get_hash_bucket(struct dma_debug_entry *entry,
267 */ 268 */
268static void put_hash_bucket(struct hash_bucket *bucket, 269static void put_hash_bucket(struct hash_bucket *bucket,
269 unsigned long *flags) 270 unsigned long *flags)
271 __releases(&bucket->lock)
270{ 272{
271 unsigned long __flags = *flags; 273 unsigned long __flags = *flags;
272 274