From: Lorenzo Stoakes Date: Sat, 26 Oct 2024 10:33:01 +0000 (+0100) Subject: mm: remove unnecessary indirection X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fbea0e35cf2750eef728c60c87b6cbadf2333029;p=users%2Fjedix%2Flinux-maple.git mm: remove unnecessary indirection Now we removed the merge logic from __mmap_new_file_vma() we can simply pass in the vma direct rather than a pointer to a VMA, as pointed out by Vlastimil. Link: https://lkml.kernel.org/r/5106696d-e625-4d8a-8545-9d1430301730@lucifer.local Signed-off-by: Lorenzo Stoakes Cc: Jann Horn Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Peter Xu Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- diff --git a/mm/vma.c b/mm/vma.c index 7194f9449c60..c26bbc898f85 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2281,10 +2281,9 @@ static int __mmap_prepare(struct mmap_state *map, struct list_head *uf) static int __mmap_new_file_vma(struct mmap_state *map, - struct vm_area_struct **vmap) + struct vm_area_struct *vma) { struct vma_iterator *vmi = map->vmi; - struct vm_area_struct *vma = *vmap; int error; vma->vm_file = get_file(map->file); @@ -2352,7 +2351,7 @@ static int __mmap_new_vma(struct mmap_state *map, struct vm_area_struct **vmap) } if (map->file) - error = __mmap_new_file_vma(map, &vma); + error = __mmap_new_file_vma(map, vma); else if (map->flags & VM_SHARED) error = shmem_zero_setup(vma); else