From cae7a76485a93a438e550f22cf74cee94acde39f Mon Sep 17 00:00:00 2001 From: Changbin Du Date: Fri, 5 Nov 2021 13:48:27 -0700 Subject: [PATCH] UPSTREAM: mm/damon: remove return value from before_terminate callback Since the return value of 'before_terminate' callback is never used, we make it have no return value. Link: https://lkml.kernel.org/r/20211029005023.8895-1-changbin.du@gmail.com Signed-off-by: Changbin Du Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 658f9ae761b5965893727dd4edcdad56e5a439bb) Bug: 228223814 Signed-off-by: zhijun wan Change-Id: Ida44623827a7a667118a2af329f6e58a57941fc9 --- include/linux/damon.h | 2 +- mm/damon/dbgfs.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 321de9d72360..b4d4be3cc987 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -322,7 +322,7 @@ struct damon_callback { int (*before_start)(struct damon_ctx *context); int (*after_sampling)(struct damon_ctx *context); int (*after_aggregation)(struct damon_ctx *context); - int (*before_terminate)(struct damon_ctx *context); + void (*before_terminate)(struct damon_ctx *context); }; /** diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index d99e5aa30194..afb4e9ebc842 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -653,12 +653,12 @@ static void dbgfs_fill_ctx_dir(struct dentry *dir, struct damon_ctx *ctx) debugfs_create_file(file_names[i], 0600, dir, ctx, fops[i]); } -static int dbgfs_before_terminate(struct damon_ctx *ctx) +static void dbgfs_before_terminate(struct damon_ctx *ctx) { struct damon_target *t, *next; if (!targetid_is_pid(ctx)) - return 0; + return; mutex_lock(&ctx->kdamond_lock); damon_for_each_target_safe(t, next, ctx) { @@ -666,7 +666,6 @@ static int dbgfs_before_terminate(struct damon_ctx *ctx) damon_destroy_target(t); } mutex_unlock(&ctx->kdamond_lock); - return 0; } static struct damon_ctx *dbgfs_new_ctx(void)