@@ -1154,9 +1154,8 @@ phys_addr_t arm_lowmem_limit __initdata = 0;
11541154
11551155void __init adjust_lowmem_bounds (void )
11561156{
1157- phys_addr_t memblock_limit = 0 ;
1158- u64 vmalloc_limit ;
1159- struct memblock_region * reg ;
1157+ phys_addr_t block_start , block_end , memblock_limit = 0 ;
1158+ u64 vmalloc_limit , i ;
11601159 phys_addr_t lowmem_limit = 0 ;
11611160
11621161 /*
@@ -1172,26 +1171,18 @@ void __init adjust_lowmem_bounds(void)
11721171 * The first usable region must be PMD aligned. Mark its start
11731172 * as MEMBLOCK_NOMAP if it isn't
11741173 */
1175- for_each_memblock (memory , reg ) {
1176- if (!memblock_is_nomap (reg )) {
1177- if (!IS_ALIGNED (reg -> base , PMD_SIZE )) {
1178- phys_addr_t len ;
1174+ for_each_mem_range (i , & block_start , & block_end ) {
1175+ if (!IS_ALIGNED (block_start , PMD_SIZE )) {
1176+ phys_addr_t len ;
11791177
1180- len = round_up (reg -> base , PMD_SIZE ) - reg -> base ;
1181- memblock_mark_nomap (reg -> base , len );
1182- }
1183- break ;
1178+ len = round_up (block_start , PMD_SIZE ) - block_start ;
1179+ memblock_mark_nomap (block_start , len );
11841180 }
1181+ break ;
11851182 }
11861183
1187- for_each_memblock (memory , reg ) {
1188- phys_addr_t block_start = reg -> base ;
1189- phys_addr_t block_end = reg -> base + reg -> size ;
1190-
1191- if (memblock_is_nomap (reg ))
1192- continue ;
1193-
1194- if (reg -> base < vmalloc_limit ) {
1184+ for_each_mem_range (i , & block_start , & block_end ) {
1185+ if (block_start < vmalloc_limit ) {
11951186 if (block_end > lowmem_limit )
11961187 /*
11971188 * Compare as u64 to ensure vmalloc_limit does
@@ -1440,19 +1431,15 @@ static void __init kmap_init(void)
14401431
14411432static void __init map_lowmem (void )
14421433{
1443- struct memblock_region * reg ;
14441434 phys_addr_t kernel_x_start = round_down (__pa (KERNEL_START ), SECTION_SIZE );
14451435 phys_addr_t kernel_x_end = round_up (__pa (__init_end ), SECTION_SIZE );
1436+ phys_addr_t start , end ;
1437+ u64 i ;
14461438
14471439 /* Map all the lowmem memory banks. */
1448- for_each_memblock (memory , reg ) {
1449- phys_addr_t start = reg -> base ;
1450- phys_addr_t end = start + reg -> size ;
1440+ for_each_mem_range (i , & start , & end ) {
14511441 struct map_desc map ;
14521442
1453- if (memblock_is_nomap (reg ))
1454- continue ;
1455-
14561443 if (end > arm_lowmem_limit )
14571444 end = arm_lowmem_limit ;
14581445 if (start >= end )
0 commit comments