On Wednesday, 25 February 2026 16:38:18 CET Andi Shyti wrote:
> > > For clarity this can be written as
> > >
> > > nr_pages = min_t(unsigned long,
> > > folio_nr_pages(folio), page_count - i);
> > > nr_pages = min_t(unsigned long, nr_pages, max_pages);
> >
> > Do you think the min_array() is less clear? Let's see what others say.
>
> min_array() is clear, it's the ((unsigned long[]) { ... }) that
> iis nice and fancy but of difficult first read. But, as I said,
> it can stay, I don't have a strong opinion, maybe I'd have done
> the same.
Would you be more happy with a locally declared unsigned long table,
initalized with those 3 values, nr_pages - i and max_segment << PAGE_SHIFT
statically, folio_nr_pages(folio) once folio is ready, then passed to
min_array()?
Thanks,
Janusz
>
> Andi
>