linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/damon/paddr: Improve readability of damon_pa_stat
@ 2025-01-13 21:01 Joshua Hahn
  2025-01-13 21:25 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Hahn @ 2025-01-13 21:01 UTC (permalink / raw)
  To: SeongJae Park; +Cc: Andrew Morton, damon, linux-kernel, linux-mm, kernel-team

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].

Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com>

[1] https://lore.kernel.org/all/20241219040327.61902-1-sj@kernel.org/
[2] https://lore.kernel.org/all/20241213215306.54778-1-sj@kernel.org/

---
 mm/damon/paddr.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index b0c283808ba6..8cdf8320f9a5 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -509,11 +509,8 @@ static unsigned long damon_pa_stat(struct damon_region *r, struct damos *s,
 		if (!folio)
 			continue;
 
-		if (damos_pa_filter_out(s, folio))
-			goto put_folio;
-		else
+		if (!damos_pa_filter_out(s, folio))
 			*sz_filter_passed += folio_size(folio);
-put_folio:
 		folio_put(folio);
 	}
 	return 0;

base-commit: 2c0573ae5b4c9c0f9d81fa0138ed0014e1baf41b
-- 
2.43.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-13 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-13 21:01 [PATCH] mm/damon/paddr: Improve readability of damon_pa_stat Joshua Hahn
2025-01-13 21:25 ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox