From: Hao Ge Date: Thu, 17 Apr 2025 09:24:22 +0000 (+0800) Subject: mm/vmscan: modify the assignment logic of the scan and total_scan variables X-Git-Tag: v6.16-rc1~92^2~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df2bbc47e707c7836756159e3530266656a9ea87;p=thirdparty%2Flinux.git mm/vmscan: modify the assignment logic of the scan and total_scan variables The scan and total_scan variables can be initialized to 0 when they are defined, replacing the separate assignment statements. Link: https://lkml.kernel.org/r/20250417092422.1333620-1-hao.ge@linux.dev Signed-off-by: Hao Ge Acked-by: Dev Jain Signed-off-by: Andrew Morton --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 3783e45bfc92e..ceffb20bb8c94 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;