diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2021-03-11 15:32:16 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2021-03-25 13:25:20 +0300 |
commit | 45c2f70cba3a7eff34574103b2e2b901a5f771aa (patch) | |
tree | e97f0d5eb619a8328d78e34705a492daf3d0b30f /arch/arm/mm/pmsa-v7.c | |
parent | d624833f5984d484c5e3196f34b926f9e71dafee (diff) | |
download | linux-45c2f70cba3a7eff34574103b2e2b901a5f771aa.tar.xz |
ARM: 9069/1: NOMMU: Fix conversion for_each_membock() to for_each_mem_range()
for_each_mem_range() uses a loop variable, yet looking into code it is
not just iteration counter but more complex entity which encodes
information about memblock. Thus condition i == 0 looks fragile.
Indeed, it broke boot of R-class platforms since it never took i == 0
path (due to i was set to 1). Fix that with restoring original flag
check.
Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/mm/pmsa-v7.c')
-rw-r--r-- | arch/arm/mm/pmsa-v7.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mm/pmsa-v7.c b/arch/arm/mm/pmsa-v7.c index 88950e41a3a9..59d916ccdf25 100644 --- a/arch/arm/mm/pmsa-v7.c +++ b/arch/arm/mm/pmsa-v7.c @@ -235,6 +235,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) phys_addr_t mem_end; phys_addr_t reg_start, reg_end; unsigned int mem_max_regions; + bool first = true; int num; u64 i; @@ -263,7 +264,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) #endif for_each_mem_range(i, ®_start, ®_end) { - if (i == 0) { + if (first) { phys_addr_t phys_offset = PHYS_OFFSET; /* @@ -275,6 +276,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) mem_start = reg_start; mem_end = reg_end; specified_mem_size = mem_end - mem_start; + first = false; } else { /* * memblock auto merges contiguous blocks, remove |