diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbitmap.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index 65c2d06250a6..5b382c1244ed 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c | |||
@@ -26,14 +26,10 @@ | |||
26 | static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) | 26 | static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) |
27 | { | 27 | { |
28 | unsigned long mask, val; | 28 | unsigned long mask, val; |
29 | unsigned long __maybe_unused flags; | ||
30 | bool ret = false; | 29 | bool ret = false; |
30 | unsigned long flags; | ||
31 | 31 | ||
32 | /* Silence bogus lockdep warning */ | 32 | spin_lock_irqsave(&sb->map[index].swap_lock, flags); |
33 | #if defined(CONFIG_LOCKDEP) | ||
34 | local_irq_save(flags); | ||
35 | #endif | ||
36 | spin_lock(&sb->map[index].swap_lock); | ||
37 | 33 | ||
38 | if (!sb->map[index].cleared) | 34 | if (!sb->map[index].cleared) |
39 | goto out_unlock; | 35 | goto out_unlock; |
@@ -54,10 +50,7 @@ static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) | |||
54 | 50 | ||
55 | ret = true; | 51 | ret = true; |
56 | out_unlock: | 52 | out_unlock: |
57 | spin_unlock(&sb->map[index].swap_lock); | 53 | spin_unlock_irqrestore(&sb->map[index].swap_lock, flags); |
58 | #if defined(CONFIG_LOCKDEP) | ||
59 | local_irq_restore(flags); | ||
60 | #endif | ||
61 | return ret; | 54 | return ret; |
62 | } | 55 | } |
63 | 56 | ||