Skip to content

Commit b7be944

Browse files
melverPeter Zijlstra
authored andcommitted
kcov: Use scoped init guard
Convert lock initialization to scoped guarded initialization where lock-guarded members are initialized in the same scope. This ensures the context analysis treats the context as active during member initialization. This is required to avoid errors once implicit context assertion is removed. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260119094029.1344361-4-elver@google.com
1 parent d084a73 commit b7be944

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/kcov.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static int kcov_open(struct inode *inode, struct file *filep)
530530
kcov = kzalloc(sizeof(*kcov), GFP_KERNEL);
531531
if (!kcov)
532532
return -ENOMEM;
533-
spin_lock_init(&kcov->lock);
533+
guard(spinlock_init)(&kcov->lock);
534534
kcov->mode = KCOV_MODE_DISABLED;
535535
kcov->sequence = 1;
536536
refcount_set(&kcov->refcount, 1);

0 commit comments

Comments
 (0)