On Sun, Jan 02, 2022 at 09:57:26PM +0000, Matthew Wilcox (Oracle) wrote: > This macro can be considerably simplified by returning the folio from > gup_folio_next() instead of void from compound_next(). Convert both > callers to work on folios instead of pages. This looks sensible, but looking at the macro I wonder if an open coded while loop (using your new calling conventions) wouldn't make formore readable code than the macro: int i = 0; ... while ((folio = gup_folio_next(i, npages, list, &ntail) != NULL)) { ... i += ntails; }