On Fri, Mar 20, 2020 at 01:49:03PM -0300, Jason Gunthorpe wrote:
> +     struct hmm_range *range = hmm_vma_walk->range;
>       unsigned int required_fault = 0;
>       unsigned long i;
>  
> -     if (hmm_vma_walk->flags & HMM_FAULT_SNAPSHOT)
> +     /*
> +      * If there is no way for valid to be set in hmm_pte_need_fault() then
> +      * don't bother to call it.
> +      */
> +     if (!(((range->flags[HMM_PFN_VALID] & range->pfn_flags_mask) |
> +            range->default_flags) &
> +           range->flags[HMM_PFN_VALID]))

I think this needs to be split out into a well documented helper
function, as it is pretty much unreadable all cramed into a complex
conditional.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to