lock_timer_base acquires a lock and returns with that lock held. Add a lock annotation to this function so that sparse can check callers for lock pairing, and so that sparse will not complain about this function since it intentionally uses the lock in this manner.
Showing the changes to kernel/timer.c (1 of 1 file). Show all
Unified · Split
| @@ -175,6 +175,7 @@ static inline void detach_timer(struct timer_list *timer, · 174 unmodified lines | ||
| 175 | 175 | */ |
| 176 | 176 | static tvec_base_t *lock_timer_base(struct timer_list *timer, |
| 177 | 177 | unsigned long *flags) |
| 178 | + __acquires(timer->base->lock) | |
| 178 | 179 | { |
| 179 | 180 | tvec_base_t *base; |
| 180 | 181 | |