Skip to content

Commit 658f9ae

Browse files
changbindutorvalds
authored andcommitted
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/[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]>
1 parent 0107865 commit 658f9ae

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/linux/damon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ struct damon_callback {
322322
int (*before_start)(struct damon_ctx *context);
323323
int (*after_sampling)(struct damon_ctx *context);
324324
int (*after_aggregation)(struct damon_ctx *context);
325-
int (*before_terminate)(struct damon_ctx *context);
325+
void (*before_terminate)(struct damon_ctx *context);
326326
};
327327

328328
/**

mm/damon/dbgfs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,18 +645,17 @@ static void dbgfs_fill_ctx_dir(struct dentry *dir, struct damon_ctx *ctx)
645645
debugfs_create_file(file_names[i], 0600, dir, ctx, fops[i]);
646646
}
647647

648-
static int dbgfs_before_terminate(struct damon_ctx *ctx)
648+
static void dbgfs_before_terminate(struct damon_ctx *ctx)
649649
{
650650
struct damon_target *t, *next;
651651

652652
if (!targetid_is_pid(ctx))
653-
return 0;
653+
return;
654654

655655
damon_for_each_target_safe(t, next, ctx) {
656656
put_pid((struct pid *)t->id);
657657
damon_destroy_target(t);
658658
}
659-
return 0;
660659
}
661660

662661
static struct damon_ctx *dbgfs_new_ctx(void)

0 commit comments

Comments
 (0)