mm/sparse: guard the size of mem_section is power of 2
Subsystems (2)
PATCH 1/1 mm/sparse: guard the size of mem_section is power of 2
We usually have this check, while commit 2a3cb8baef71 ("mm/sparse:
delete old sparse_init and enable new one") missed to take it.
Signed-off-by Wei Yang <[email protected]>
CC Pavel Tatashin <[email protected]>
--- mm/sparse.c | 2 ++ 1 file changed, 2 insertions(+)
mm/sparse.c +2 -0
@@ -560,6 +560,8 @@ void __init sparse_init(void)unsigned long pnum_end, pnum_begin, map_count =1 ;int nid_begin; +/* see include/linux/mmzone.h 'struct mem_section' definition */ +BUILD_BUG_ON (!is_power_of_2 (sizeof (struct mem_section )));memblocks_present (); pnum_begin =first_present_section_nr ();
Signature · 1 line
2.34.1
Quoted 5 lines · Wei Yang
We usually have this check, while commit
2a3cb8baef71("mm/sparse:
delete oldsparse_initand enable new one") missed to take it.Signed-off-by Wei Yang <[email protected]>CC Pavel Tatashin <[email protected]>
Acked-by Oscar Salvador <[email protected]>
Signature · 2 lines
Oscar Salvador SUSE Labs
Quoted 15 lines · Wei Yang
We usually have this check, while commit
2a3cb8baef71("mm/sparse:
delete oldsparse_initand enable new one") missed to take it.Signed-off-by Wei Yang <[email protected]>CC Pavel Tatashin <[email protected]>--- mm/sparse.c | 2 ++ 1 file changed, 2 insertions(+)mm/sparse.c +0
-0
mm/sparse.c void __init sparse_init(void) · line 564
Quoted 5 lines
mm/sparse.c +2
-0@@ -560,6 +560,8 @@ void __init sparse_init(void)unsigned long pnum_end, pnum_begin, map_count =1 ;int nid_begin; +/* see include/linux/mmzone.h 'struct mem_section' definition */ +BUILD_BUG_ON (!is_power_of_2 (sizeof (struct mem_section )));
Reviewed-by Pasha Tatashin <[email protected]>
Thanks,
Pasha