Commit 3c4aac86 authored by Alexander Kuleshov's avatar Alexander Kuleshov Committed by Martin Schwidefsky

s390/crash_dump: use for_each_mem_range

The <linux/memblock.h> already provides for_each_mem_range() macro that
iterates through memblock areas from type_a and not included in type_b.
We can remove custom for_each_dump_mem_range() macro and use the
for_each_mem_range() instead.
Signed-off-by: default avatarAlexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 1afc82ae
...@@ -32,16 +32,6 @@ static struct memblock_type oldmem_type = { ...@@ -32,16 +32,6 @@ static struct memblock_type oldmem_type = {
.regions = &oldmem_region, .regions = &oldmem_region,
}; };
#define for_each_dump_mem_range(i, nid, p_start, p_end, p_nid) \
for (i = 0, __next_mem_range(&i, nid, MEMBLOCK_NONE, \
&memblock.physmem, \
&oldmem_type, p_start, \
p_end, p_nid); \
i != (u64)ULLONG_MAX; \
__next_mem_range(&i, nid, MEMBLOCK_NONE, &memblock.physmem,\
&oldmem_type, \
p_start, p_end, p_nid))
struct dump_save_areas dump_save_areas; struct dump_save_areas dump_save_areas;
/* /*
...@@ -515,7 +505,8 @@ static int get_mem_chunk_cnt(void) ...@@ -515,7 +505,8 @@ static int get_mem_chunk_cnt(void)
int cnt = 0; int cnt = 0;
u64 idx; u64 idx;
for_each_dump_mem_range(idx, NUMA_NO_NODE, NULL, NULL, NULL) for_each_mem_range(idx, &memblock.physmem, &oldmem_type, NUMA_NO_NODE,
MEMBLOCK_NONE, NULL, NULL, NULL)
cnt++; cnt++;
return cnt; return cnt;
} }
...@@ -528,7 +519,8 @@ static void loads_init(Elf64_Phdr *phdr, u64 loads_offset) ...@@ -528,7 +519,8 @@ static void loads_init(Elf64_Phdr *phdr, u64 loads_offset)
phys_addr_t start, end; phys_addr_t start, end;
u64 idx; u64 idx;
for_each_dump_mem_range(idx, NUMA_NO_NODE, &start, &end, NULL) { for_each_mem_range(idx, &memblock.physmem, &oldmem_type, NUMA_NO_NODE,
MEMBLOCK_NONE, &start, &end, NULL) {
phdr->p_filesz = end - start; phdr->p_filesz = end - start;
phdr->p_type = PT_LOAD; phdr->p_type = PT_LOAD;
phdr->p_offset = start; phdr->p_offset = start;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment