diff options
Diffstat (limited to 'arch/s390/boot/mem_detect.c')
-rw-r--r-- | arch/s390/boot/mem_detect.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/s390/boot/mem_detect.c b/arch/s390/boot/mem_detect.c index 3058d397a9da..35f4ba11f7fd 100644 --- a/arch/s390/boot/mem_detect.c +++ b/arch/s390/boot/mem_detect.c @@ -172,20 +172,20 @@ unsigned long detect_memory(unsigned long *safe_addr) return max_physmem_end; } -void mem_detect_truncate(unsigned long limit) +void mem_detect_set_usable_limit(unsigned long limit) { struct mem_detect_block *block; int i; + /* make sure mem_detect.usable ends up within online memory block */ for (i = 0; i < mem_detect.count; i++) { block = __get_mem_detect_block_ptr(i); - if (block->start >= limit) { - mem_detect.count = i; + if (block->start >= limit) break; - } else if (block->end > limit) { - block->end = (u64)limit; - mem_detect.count = i + 1; + if (block->end >= limit) { + mem_detect.usable = limit; break; } + mem_detect.usable = block->end; } } |