path: root/mm/nommu.c
diff options
authorWei Yang <>2019-11-30 17:50:53 -0800
committerLinus Torvalds <>2019-12-01 06:29:19 -0800
commitaba6dfb75fe15650991442efd137c32fbf2e2b85 (patch)
tree413724e68ad7e10d88f9cc738d220eb241d605e7 /mm/nommu.c
parent1b9fc5b24fa2e7c0e67778cda77ac231fb4bcac7 (diff)
mm/mmap.c: rb_parent is not necessary in __vma_link_list()
Now we use rb_parent to get next, while this is not necessary. When prev is NULL, this means vma should be the first element in the list. Then next should be current first one (mm->mmap), no matter whether we have parent or not. After removing it, the code shows the beauty of symmetry. Link: Signed-off-by: Wei Yang <> Acked-by: Andrew Morton <> Cc: Mel Gorman <> Cc: Vlastimil Babka <> Cc: Matthew Wilcox <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/nommu.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index 47a58b32fdc9..bd2b4e5ef144 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -648,7 +648,7 @@ static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
if (rb_prev)
prev = rb_entry(rb_prev, struct vm_area_struct, vm_rb);
- __vma_link_list(mm, vma, prev, parent);
+ __vma_link_list(mm, vma, prev);