cxl: don't manipulate the mm.mm_users field directly
PATCH 1/1 cxl: don't manipulate the mm.mm_users field directly
It is better to rely on the API provided by the MM layer instead of directly manipulating the mm_users field.
Signed-off-by Laurent Dufour <[email protected]>
--- drivers/misc/cxl/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/cxl/fault.c +1 -1
@@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx)if (ctx->mm ==NULL )return NULL ; -if (!atomic_inc_not_zero (&ctx->mm->mm_users)) +if (!mmget_not_zero (ctx->mm))return NULL ;return ctx->mm;
Signature · 1 line
2.30.1
Quoted 5 lines · Laurent Dufour
It is better to rely on the API provided by the MM layer instead of directly manipulating the
mm_usersfield.Signed-off-by Laurent Dufour <[email protected]>---
Thanks!
Acked-by Frederic Barrat <[email protected]>
Quoted 17 lines
drivers/misc/cxl/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/cxl/fault.c +1
-1@@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx)if (ctx->mm ==NULL )return NULL ; -if (!atomic_inc_not_zero (&ctx->mm->mm_users)) +if (!mmget_not_zero (ctx->mm))return NULL ;return ctx->mm;
Quoted 4 lines · Laurent Dufour
It is better to rely on the API provided by the MM layer instead of directly manipulating the
mm_usersfield.Signed-off-by Laurent Dufour <[email protected]>
LGTM, thanks for picking this up
Acked-by Andrew Donnellan <[email protected]>
Signature · 2 lines
Andrew Donnellan OzLabs, ADL Canberra [email protected] IBM Australia Limited
Michael Ellerman
AppliedQuoted 2 lines · Laurent Dufour
It is better to rely on the API provided by the MM layer instead of directly manipulating the
mm_usersfield.
Applied to powerpc/next.
[1/1] cxl: don't manipulate the mm.mm_users field directly
https://git.kernel.org/powerpc/c/2d9f69bc5a5a75579b410beb0dc3d313be762c9f
cheers