mm/damon: use 'struct damon_target *' instead of 'void *' in target_valid()

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>
This commit is contained in:
Kaixu Xia 2022-09-15 19:33:41 +08:00 committed by Andrew Morton
parent a07b8eafa4
commit 16bc1b0f02
2 changed files with 2 additions and 3 deletions

View 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);
};

View 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);