mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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
This commit is contained in:
committed by
Peter Zijlstra
parent
d084a73714
commit
b7be9442a3
@@ -530,7 +530,7 @@ static int kcov_open(struct inode *inode, struct file *filep)
|
||||
kcov = kzalloc(sizeof(*kcov), GFP_KERNEL);
|
||||
if (!kcov)
|
||||
return -ENOMEM;
|
||||
spin_lock_init(&kcov->lock);
|
||||
guard(spinlock_init)(&kcov->lock);
|
||||
kcov->mode = KCOV_MODE_DISABLED;
|
||||
kcov->sequence = 1;
|
||||
refcount_set(&kcov->refcount, 1);
|
||||
|
||||
Reference in New Issue
Block a user