diff options
Diffstat (limited to 'lib/sbitmap.c')
-rw-r--r-- | lib/sbitmap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index a89fbe7cf6ca..2261136ae067 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c | |||
@@ -118,8 +118,13 @@ static int __sbitmap_get_word(unsigned long *word, unsigned long depth, | |||
118 | static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) | 118 | static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) |
119 | { | 119 | { |
120 | unsigned long mask, val; | 120 | unsigned long mask, val; |
121 | unsigned long __maybe_unused flags; | ||
121 | bool ret = false; | 122 | bool ret = false; |
122 | 123 | ||
124 | /* Silence bogus lockdep warning */ | ||
125 | #if defined(CONFIG_LOCKDEP) | ||
126 | local_irq_save(flags); | ||
127 | #endif | ||
123 | spin_lock(&sb->map[index].swap_lock); | 128 | spin_lock(&sb->map[index].swap_lock); |
124 | 129 | ||
125 | if (!sb->map[index].cleared) | 130 | if (!sb->map[index].cleared) |
@@ -142,6 +147,9 @@ static inline bool sbitmap_deferred_clear(struct sbitmap *sb, int index) | |||
142 | ret = true; | 147 | ret = true; |
143 | out_unlock: | 148 | out_unlock: |
144 | spin_unlock(&sb->map[index].swap_lock); | 149 | spin_unlock(&sb->map[index].swap_lock); |
150 | #if defined(CONFIG_LOCKDEP) | ||
151 | local_irq_restore(flags); | ||
152 | #endif | ||
145 | return ret; | 153 | return ret; |
146 | } | 154 | } |
147 | 155 | ||