mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 19:31:42 -04:00
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>
This commit is contained in:
committed by
Andrew Morton
parent
19c4707b53
commit
35520a712f
@@ -156,7 +156,7 @@ static unsigned long damon_pa_pageout(struct damon_region *r,
|
||||
LIST_HEAD(folio_list);
|
||||
bool install_young_filter = true;
|
||||
struct damos_filter *filter;
|
||||
struct folio *folio;
|
||||
struct folio *folio = NULL;
|
||||
|
||||
/* check access in page level again by default */
|
||||
damos_for_each_ops_filter(filter, s) {
|
||||
@@ -212,7 +212,7 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
|
||||
unsigned long *sz_filter_passed)
|
||||
{
|
||||
phys_addr_t addr, applied = 0;
|
||||
struct folio *folio;
|
||||
struct folio *folio = NULL;
|
||||
|
||||
addr = damon_pa_phys_addr(r->ar.start, addr_unit);
|
||||
while (addr < damon_pa_phys_addr(r->ar.end, addr_unit)) {
|
||||
@@ -262,7 +262,7 @@ static unsigned long damon_pa_migrate(struct damon_region *r,
|
||||
{
|
||||
phys_addr_t addr, applied;
|
||||
LIST_HEAD(folio_list);
|
||||
struct folio *folio;
|
||||
struct folio *folio = NULL;
|
||||
|
||||
addr = damon_pa_phys_addr(r->ar.start, addr_unit);
|
||||
while (addr < damon_pa_phys_addr(r->ar.end, addr_unit)) {
|
||||
@@ -295,7 +295,7 @@ static unsigned long damon_pa_stat(struct damon_region *r,
|
||||
unsigned long *sz_filter_passed)
|
||||
{
|
||||
phys_addr_t addr;
|
||||
struct folio *folio;
|
||||
struct folio *folio = NULL;
|
||||
|
||||
if (!damos_ops_has_filter(s))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user