[PATCH v1 1/2] kho: remove useless phys increment in inner loop
Chenghao Duan
duanchenghao at kylinos.cn
Fri Aug 7 00:51:27 PDT 2026
The statement phys += contig_pages * PAGE_SIZE at the end of the inner
for-loop in kho_restore_vmalloc() is redundant code. The variable 'phys'
is local to each loop iteration (re-assigned from chunk->phys[i] on every
iteration) and is never referenced after this increment, so the statement
has no functional impact. Remove it to avoid confusion during code review.
Signed-off-by: Chenghao Duan <duanchenghao at kylinos.cn>
---
kernel/liveupdate/kexec_handover.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
index 175c08a6e41e..ba03ff5baa9e 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -1191,8 +1191,6 @@ void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
for (int j = 0; j < contig_pages; j++)
pages[idx++] = page + j;
-
- phys += contig_pages * PAGE_SIZE;
}
page = kho_restore_pages(virt_to_phys(chunk), 1);
--
2.25.1
More information about the kexec
mailing list