Re: [PATCH v5 4/4] mm/gup: clean up codes in fault_in_xxx() functions

David Hildenbrand
2025-04-13T20:09:34Z

On 13.04.25 04:04, Baoquan He wrote:
> The code style in fault_in_readable() and fault_in_writable() is a
> little inconsistent with fault_in_safe_writeable(). In fault_in_readable()
> and fault_in_writable(), it uses 'uaddr' passed in as loop cursor. While
> in fault_in_safe_writeable(), local variable 'start' is used as loop
> cursor. This may mislead people when reading code or making change in
> these codes.
>
> Here define explicit loop cursor and use for loop to simplify codes in
> these three functions. These cleanup can make them be consistent in
> code style and improve readability.
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---

Hopefully we don't introduce anything unexpected ... do we have some
unit test that could make use feel better, especially regarding end < start?

If not, could we add one based on some feature that ends up calling at
least one of these functions?

Acked-by: David Hildenbrand <david@redhat.com>

--
Cheers,

David / dhildenb