linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/migrate: remove redundant variables used in a for-loop
@ 2021-12-21 18:57 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2021-12-21 18:57 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: kernel-janitors, linux-kernel

The variable addr is being set and incremented in a for-loop
but not actually being used. It is redundant and so addr and
also variable start can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 mm/migrate.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index c9296d63878d..38d4df747172 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2459,8 +2459,7 @@ static bool migrate_vma_check_page(struct page *page)
 static void migrate_vma_unmap(struct migrate_vma *migrate)
 {
 	const unsigned long npages = migrate->npages;
-	const unsigned long start = migrate->start;
-	unsigned long addr, i, restore = 0;
+	unsigned long i, restore = 0;
 	bool allow_drain = true;
 
 	lru_add_drain();
@@ -2506,7 +2505,7 @@ static void migrate_vma_unmap(struct migrate_vma *migrate)
 		}
 	}
 
-	for (addr = start, i = 0; i < npages && restore; addr += PAGE_SIZE, i++) {
+	for (i = 0; i < npages && restore; i++) {
 		struct page *page = migrate_pfn_to_page(migrate->src[i]);
 
 		if (!page || (migrate->src[i] & MIGRATE_PFN_MIGRATE))
-- 
2.33.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-21 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 18:57 [PATCH] mm/migrate: remove redundant variables used in a for-loop Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox