Skip to content

Commit 4817a52

Browse files
author
Peter Zijlstra
committed
seqlock,lockdep: Fix seqcount_latch_init()
seqcount_init() must be a macro in order to preserve the static variable that is used for the lockdep key. Don't then wrap it in an inline function, which destroys that. Luckily there aren't many users of this function, but fix it before it becomes a problem. Fixes: 80793c3 ("seqlock: Introduce seqcount_latch_t") Reported-by: Eric Dumazet <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent d5b0e06 commit 4817a52

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/linux/seqlock.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,7 @@ typedef struct {
664664
* seqcount_latch_init() - runtime initializer for seqcount_latch_t
665665
* @s: Pointer to the seqcount_latch_t instance
666666
*/
667-
static inline void seqcount_latch_init(seqcount_latch_t *s)
668-
{
669-
seqcount_init(&s->seqcount);
670-
}
667+
#define seqcount_latch_init(s) seqcount_init(&(s)->seqcount)
671668

672669
/**
673670
* raw_read_seqcount_latch() - pick even/odd latch data copy

0 commit comments

Comments
 (0)