diff options
| author | Marco Elver <elver@google.com> | 2026-01-19 10:05:53 +0100 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-01-28 20:45:24 +0100 |
| commit | b7be9442a3758a27a4b09b75ad79f3626b16ec3d (patch) | |
| tree | a3a5242d008a9b86c75a9816e5ae6efac2a44e6a /kernel | |
| parent | d084a73714f818ce509022e1aa9483cabf797c16 (diff) | |
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
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/kcov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/kcov.c b/kernel/kcov.c index 6cbc6e2d8aee..5397d0c14127 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c @@ -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); |
