Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon/paddr: initialize 'folio' variables to NULL for clarity

In damon_pa_mark_accessed_or_deactivate(), damon_pa_pageout(),
damon_pa_migrate(), and damon_pa_stat(), the local variable 'folio' is
declared but not initialized.

Initialize 'folio' to NULL to improve code readability and
maintainability.

Link: https://patch.msgid.link/20260104013255.16962-1-yangqixiao@inspur.com
Link: https://lkml.kernel.org/r/20260108013041.80601-1-sj@kernel.org
Signed-off-by: Aaron Yang <yangqixiao@inspur.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Aaron Yang and committed by
Andrew Morton
35520a71 19c4707b

+4 -4
+4 -4
mm/damon/paddr.c
··· 156 156 LIST_HEAD(folio_list); 157 157 bool install_young_filter = true; 158 158 struct damos_filter *filter; 159 - struct folio *folio; 159 + struct folio *folio = NULL; 160 160 161 161 /* check access in page level again by default */ 162 162 damos_for_each_ops_filter(filter, s) { ··· 212 212 unsigned long *sz_filter_passed) 213 213 { 214 214 phys_addr_t addr, applied = 0; 215 - struct folio *folio; 215 + struct folio *folio = NULL; 216 216 217 217 addr = damon_pa_phys_addr(r->ar.start, addr_unit); 218 218 while (addr < damon_pa_phys_addr(r->ar.end, addr_unit)) { ··· 262 262 { 263 263 phys_addr_t addr, applied; 264 264 LIST_HEAD(folio_list); 265 - struct folio *folio; 265 + struct folio *folio = NULL; 266 266 267 267 addr = damon_pa_phys_addr(r->ar.start, addr_unit); 268 268 while (addr < damon_pa_phys_addr(r->ar.end, addr_unit)) { ··· 295 295 unsigned long *sz_filter_passed) 296 296 { 297 297 phys_addr_t addr; 298 - struct folio *folio; 298 + struct folio *folio = NULL; 299 299 300 300 if (!damos_ops_has_filter(s)) 301 301 return 0;