diff options
author | Zhang Yanfei <zhangyanfei@cn.fujitsu.com> | 2013-01-11 16:57:20 +0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-01-30 13:15:21 +0900 |
commit | 348896c70439534a6cef78496036dea82a93c19b (patch) | |
tree | 6ce154b1e82de9b8444f4d8d1be9ed696451f898 /kexec/arch/i386/kexec-multiboot-x86.c | |
parent | d722eba67e5c54645588df8e56b56d7722f29431 (diff) |
kexec,x86: remove duplicate get_memory_ranges
At first, we have already filled the kexec_info.memory_ranges by
calling my_load() -> get_memory_ranges(). So if we want to
get the memory information, we could just use the existing
one instead of calling get_memory_ranges again.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/i386/kexec-multiboot-x86.c')
-rw-r--r-- | kexec/arch/i386/kexec-multiboot-x86.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kexec/arch/i386/kexec-multiboot-x86.c b/kexec/arch/i386/kexec-multiboot-x86.c index 23dab7b..de2a423 100644 --- a/kexec/arch/i386/kexec-multiboot-x86.c +++ b/kexec/arch/i386/kexec-multiboot-x86.c @@ -248,11 +248,8 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len, mbi->boot_loader_name = sizeof(*mbi) + command_line_len; /* Memory map */ - if ((get_memory_ranges(&range, &ranges, info->kexec_flags) < 0) - || ranges == 0) { - fprintf(stderr, "Cannot get memory information\n"); - return -1; - } + range = info->memory_range; + ranges = info->memory_ranges; mmap = xmalloc(ranges * sizeof(*mmap)); for (i=0; i<ranges; i++) { unsigned long long length; |