mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-05 10:17:58 -05:00
mm: check __highest_present_section_nr directly in memory_dev_init()
__highest_present_section_nr is a more strict boundary than NR_MEM_SECTIONS. So checking __highest_present_section_nr directly is enough. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Michal Hocko <[email protected]> Cc: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
09a913a7a9
commit
bc8755ba66
1 changed files with 2 additions and 5 deletions
|
|
@ -837,11 +837,8 @@ int __init memory_dev_init(void)
|
|||
* during boot and have been initialized
|
||||
*/
|
||||
mutex_lock(&mem_sysfs_mutex);
|
||||
for (i = 0; i < NR_MEM_SECTIONS; i += sections_per_block) {
|
||||
/* Don't iterate over sections we know are !present: */
|
||||
if (i > __highest_present_section_nr)
|
||||
break;
|
||||
|
||||
for (i = 0; i <= __highest_present_section_nr;
|
||||
i += sections_per_block) {
|
||||
err = add_memory_block(i);
|
||||
if (!ret)
|
||||
ret = err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue