Message ID | 20220916133535.7428-1-xhao@linux.alibaba.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/damon/sysfs: more simplified code calls damon_target_has_pid() | expand |
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index dc8dd56d6589..7692c706bcc5 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -2132,10 +2132,7 @@ static int damon_sysfs_set_attrs(struct damon_ctx *ctx, static void damon_sysfs_destroy_targets(struct damon_ctx *ctx) { struct damon_target *t, *next; - bool has_pid = false; - - if (damon_target_has_pid(ctx)) - has_pid = true; + bool has_pid = damon_target_has_pid(ctx); damon_for_each_target_safe(t, next, ctx) { if (has_pid)