[PATCH v6 68/71] riscv: Use vma iterator for vdso

From: Liam Howlett
Date: Tue Feb 15 2022 - 09:48:06 EST


Remove the linked list use in favour of the vma iterator.

Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
arch/riscv/kernel/vdso.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index a9436a65161a..5dcc80f92587 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -116,10 +116,11 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns)
{
struct mm_struct *mm = task->mm;
struct vm_area_struct *vma;
+ VMA_ITERATOR(vmi, mm, 0);

mmap_read_lock(mm);

- for (vma = mm->mmap; vma; vma = vma->vm_next) {
+ for_each_vma(vmi, next) {
unsigned long size = vma->vm_end - vma->vm_start;

if (vma_is_special_mapping(vma, vdso_info.dm))
--
2.34.1