Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: cxl: use mmgrab

Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab()
helper") and most of the kernel was updated to use it. Update a
remaining file.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

<smpl>
@@ expression e; @@
- atomic_inc(&e->mm_count);
+ mmgrab(e);
</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
Link: https://lore.kernel.org/r/1577634178-22530-2-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Julia Lawall and committed by
Greg Kroah-Hartman
e10e0246 19194169

+1 -1
+1 -1
drivers/misc/cxl/context.c
··· 352 352 void cxl_context_mm_count_get(struct cxl_context *ctx) 353 353 { 354 354 if (ctx->mm) 355 - atomic_inc(&ctx->mm->mm_count); 355 + mmgrab(ctx->mm); 356 356 } 357 357 358 358 void cxl_context_mm_count_put(struct cxl_context *ctx)