]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/damon: use 'struct damon_target *' instead of 'void *' in target_valid()
authorKaixu Xia <kaixuxia@tencent.com>
Thu, 15 Sep 2022 11:33:41 +0000 (19:33 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:03:26 +0000 (14:03 -0700)
We could use 'struct damon_target *' directly instead of 'void *' in
target_valid() operation to make code simple.

Link: https://lkml.kernel.org/r/1663241621-13293-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/damon.h
mm/damon/vaddr.c

index c5dc0c77c7722012515b307ed6701912dcafc7ea..1dda8d0068e54a412422a3de08250ae004087a6d 100644 (file)
@@ -346,7 +346,7 @@ struct damon_operations {
        unsigned long (*apply_scheme)(struct damon_ctx *context,
                        struct damon_target *t, struct damon_region *r,
                        struct damos *scheme);
-       bool (*target_valid)(void *target);
+       bool (*target_valid)(struct damon_target *t);
        void (*cleanup)(struct damon_ctx *context);
 };
 
index 3f84584f998263039a724446a112bbe7caa8bd67..f53c2ff2bcc8acec5f42a3dd47ff58a676c0f2e5 100644 (file)
@@ -593,9 +593,8 @@ static unsigned int damon_va_check_accesses(struct damon_ctx *ctx)
  * Functions for the target validity check and cleanup
  */
 
-static bool damon_va_target_valid(void *target)
+static bool damon_va_target_valid(struct damon_target *t)
 {
-       struct damon_target *t = target;
        struct task_struct *task;
 
        task = damon_get_task_struct(t);