Re: [PATCH] mm/damon/stat: avoid iterating targets in damon_stat_sort_regions()

[email protected]
Newsgroups dev.linux.lists.damon
Message-ID <[email protected]>
> damon/stat module creates only one target in damon_stat_build_ctx(), and
> the comment in damon_stat_sort_regions() already says so.  But the code
> still iterates adaptive_targets with damon_for_each_target(), which is
> needlessly verbose and adds an extra indentation level.
> 
> Just use list_first_entry() to grab the single target, with a
> list_empty() check to be safe.
> 
> Signed-off-by: Enze Li <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.