Re: [PATCH] mm/damon/core: use list_{next,prev}_entry() in damon_{next,prev}_region()
From: SJ Park
Date: Tue Nov 03 2026 - 09:54:13 EST
On Tue, 03 Nov 2026 21:31:41 +1100 Aveline Noir <jm5905938@xxxxxxxxx> wrote:
> Hi Enze,
>
> On Tue, 03 Nov 2026 18:07:14 +0800 Enze Li wrote:
>
> > damon_next_region() and damon_prev_region() manually do container_of()
> > type casting to fetch the next and previous region from the linked
> > list. Use the dedicated list.h helpers, list_next_entry() and
> > list_prev_entry(), as damon_first_region() and damon_last_region() do.
>
> The change looks correct to me. list_{next,prev}_entry() expand to the
> same container_of() calls, so there is no functional change.
>
> That said, my understanding is that the kernel generally discourages
> changes made only for coding style, outside of other work on the same
> code. Documentation/process/4.Coding.rst notes that "pure coding style
> fixes are seen as noise by the development community".
>
> SJ, what do you think about this kind of cleanup for DAMON?
I think whether it is noise or not depend on each change and the volume of
traffic. Let's suppose a patch for a real trivial change and there are many
patches for critical bug fixes waiting for reviews. In the case, I think the
trivial patch should be deprioritized, and we should discourage sending such
patches while the urgent reviews are done. If there are bandiwdth for review,
it is no problem. Nonetheless, I would dislike patches that making only
trivial cosmetic changes that doesn't really improve maintainability.
I feel like we have review bandwidth now, and this change looks like a
meaningful code maintainability improvement to me.
Thanks,
SJ
[...]