[PATCH v1 04/16] mm/memory: simplify calculation in unmap_mapping_range_tree()
David Hildenbrand (Arm)
david at kernel.org
Wed Mar 11 19:09:38 AEDT 2026
>
>> - start = ((zba - vba) << PAGE_SHIFT) + vma->vm_start;
>> - size = (zea - zba + 1) << PAGE_SHIFT;
>> + const pgoff_t start_idx = max(first_index, vma->vm_pgoff);
>> + const pgoff_t end_idx = min(last_index, vma_last_pgoff(vma)) + 1;
>
> I guess since 'end' is by-convention the +1 of last this is fine
Exactly, the calculation itself is not changed.
The +1 was previously hiding inside the "(zea - zba + 1)"
Thanks!
--
Cheers,
David
More information about the Linuxppc-dev
mailing list