On Fri, Mar 13, 2026 at 03:09:41PM +0000, Adrián Larumbe wrote:
> From: Boris Brezillon <[email protected]>
> 
> We are going to add flags/properties that will impact the VA merging
> ability. Instead of sprinkling tests all over the place in
> __drm_gpuvm_sm_map(), let's add a helper aggregating all these checks
> can call it for every existing VA we walk through in the
> __drm_gpuvm_sm_map() loop.
> 
> Signed-off-by: Boris Brezillon <[email protected]>
> Signed-off-by: Caterina Shablia <[email protected]>

> +     /* We intentionally ignore u64 underflows because all we care about
> +      * here is whether the VA diff matches the GEM offset diff.
> +      */
> +     return b->va.addr - a->va.addr == b->gem.offset - a->gem.offset;

Please use wrapping_sub() to make it clear to sanitizers etc that
underflow is intentional in this case.

Alice

Reply via email to