mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
mm: remove unnecessary empty range check in early_calculate_totalpages()
early_calculate_totalpages() iterates the memory ranges with for_each_mem_pfn_range() and calls node_set_state(nid, N_MEMORY) only when end_pfn - start_pfn is non-zero. for_each_mem_pfn_range() never returns an empty range, so start_pfn < end_pfn always. Therefore the check is unnecessary, so remove it. No functional change. Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Link: https://patch.msgid.link/20260630150413.1718632-8-ekffu200098@gmail.com Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
This commit is contained in:
parent
21e95a4b6f
commit
c6af91e485
|
|
@ -332,8 +332,7 @@ static unsigned long __init early_calculate_totalpages(void)
|
|||
unsigned long pages = end_pfn - start_pfn;
|
||||
|
||||
totalpages += pages;
|
||||
if (pages)
|
||||
node_set_state(nid, N_MEMORY);
|
||||
node_set_state(nid, N_MEMORY);
|
||||
}
|
||||
return totalpages;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user