Hi Jonathan,

On 2026-02-04 at 23:03:08 +0000, Jonathan Cavitt wrote:
> Static analysis issue:
> 
> The current implementations of the eb_relocate_vma and
> eb_relocate_vma_slow functions cast the return value of
> eb_relocate_entry to a signed long in order to determine if an error has
> occurred.  This is because the return value of eb_relocate_entry is a
> u64 offset value on a success and a negative error value on a failure.
> 
> While not mechanically incorrect,
This might lower the perceived need for this change, just leave
that it is improper to cast stuff like this and that should be good.

> it is improper to perform a cast like
> this.  So, just have eb_relocate_entry (and, by extension, its helper
> function relocate_entry) return the error value, storing the offset
> separately in a passed u64 pointer.
> 
> Interestingly, this value is only used for non-error-checking purposes
> in the eb_relocate_vma case.  We can simplify the eb_relocate_vma_slow
> case by allowing the passed u64 pointer to be NULL because of this.
> 
> Signed-off-by: Jonathan Cavitt <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> ---

I think the code looks good, but you should address failures
from i915 CI - both test runs on this patch look more or less
the same, so this change might be breaking something.

-- 
Best Regards,
Krzysztof

Reply via email to