linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vmscan: Modify the assignment logic of the scan and total_scan variables
@ 2025-04-17  9:24 Hao Ge
  2025-04-17  9:35 ` Dev Jain
  0 siblings, 1 reply; 2+ messages in thread
From: Hao Ge @ 2025-04-17  9:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, Hao Ge

From: Hao Ge <gehao@kylinos.cn>

The scan and total_scan variables can be initialized to 0
when they are defined, replacing the separate assignment statements.

Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
 mm/vmscan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b620d74b0f66..bf360ac4f1cf 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1725,13 +1725,11 @@ static unsigned long isolate_lru_folios(unsigned long nr_to_scan,
 	unsigned long nr_taken = 0;
 	unsigned long nr_zone_taken[MAX_NR_ZONES] = { 0 };
 	unsigned long nr_skipped[MAX_NR_ZONES] = { 0, };
-	unsigned long skipped = 0;
-	unsigned long scan, total_scan, nr_pages;
+	unsigned long skipped = 0, total_scan = 0, scan = 0;
+	unsigned long nr_pages;
 	unsigned long max_nr_skipped = 0;
 	LIST_HEAD(folios_skipped);
 
-	total_scan = 0;
-	scan = 0;
 	while (scan < nr_to_scan && !list_empty(src)) {
 		struct list_head *move_to = src;
 		struct folio *folio;
-- 
2.25.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-17  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-17  9:24 [PATCH] mm/vmscan: Modify the assignment logic of the scan and total_scan variables Hao Ge
2025-04-17  9:35 ` Dev Jain

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