Skip to content

Commit f57f63b

Browse files
joshuahahnakpm00
authored andcommitted
mm/damon/paddr: improve readability of damon_pa_stat
damon_pa_stat contains an unnecessary goto statement, and the if/else can be re-written to be more readable. This patch is written on top of SJ's patch series [1], which in turn is written on top of another one of his series [2]. [1] https://lore.kernel.org/all/20241219040327.61902-1-sj@kernel.org/ [2] https://lore.kernel.org/all/20241213215306.54778-1-sj@kernel.org/ Link: https://lkml.kernel.org/r/20250113210201.446051-1-joshua.hahnjy@gmail.com Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent bdbe1d7 commit f57f63b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

mm/damon/paddr.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,8 @@ static unsigned long damon_pa_stat(struct damon_region *r, struct damos *s,
513513
continue;
514514
}
515515

516-
if (damos_pa_filter_out(s, folio))
517-
goto put_folio;
518-
else
516+
if (!damos_pa_filter_out(s, folio))
519517
*sz_filter_passed += folio_size(folio);
520-
put_folio:
521518
addr += folio_size(folio);
522519
folio_put(folio);
523520
}

0 commit comments

Comments
 (0)