Skip to content

Commit

Permalink
mm/damon: remove return value from before_terminate callback
Browse files Browse the repository at this point in the history
Since the return value of 'before_terminate' callback is never used, we
make it have no return value.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
changbindu authored and torvalds committed Nov 6, 2021
1 parent 0107865 commit 658f9ae
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/linux/damon.h
Original file line number Diff line number Diff line change
@@ -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);
};

/**
5 changes: 2 additions & 3 deletions mm/damon/dbgfs.c
Original file line number Diff line number Diff line change
@@ -645,18 +645,17 @@ 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;

damon_for_each_target_safe(t, next, ctx) {
put_pid((struct pid *)t->id);
damon_destroy_target(t);
}
return 0;
}

static struct damon_ctx *dbgfs_new_ctx(void)

0 comments on commit 658f9ae

Please sign in to comment.