can_merge_right implies can_vma_merge_right() has checked the pgoff. Don't need to assign it again. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> CC: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> --- mm/vma.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/vma.c b/mm/vma.c index 4737afcb064c..fb4f1863f88e 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -915,7 +915,6 @@ struct vm_area_struct *vma_merge_new_range(struct vma_merge_struct *vmg) unsigned long start = vmg->start; unsigned long end = vmg->end; pgoff_t pgoff = vmg->pgoff; - pgoff_t pglen = PHYS_PFN(end - start); bool can_merge_left, can_merge_right; mmap_assert_write_locked(vmg->mm); @@ -936,7 +935,6 @@ struct vm_area_struct *vma_merge_new_range(struct vma_merge_struct *vmg) if (can_merge_right) { vmg->end = next->vm_end; vmg->vma = next; - vmg->pgoff = next->vm_pgoff - pglen; } /* If we can merge with the previous VMA, adjust vmg accordingly. */ -- 2.34.1