diff options
author | Simon Horman <horms@verge.net.au> | 2006-09-22 16:45:32 +0900 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-10-06 12:46:16 +0900 |
commit | c506e2859d2b890bd6ada04fa11e434ba5d87b1e (patch) | |
tree | 132fb11abbaa2554515674b42678ea52d3691a1e /purgatory | |
parent | ef14c5794bed504f83d2a0721a88993f0c64099b (diff) | |
download | kexec-tools-c506e2859d2b890bd6ada04fa11e434ba5d87b1e.tar.gz |
kexec-ktools: remove duplicated code in patch_efi_memmap()
This patch removes a duplicated assignment of *md2.
It also replaces a switch statement with an if statement
which is much more compact in this instance.
Signed-Off-By: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r-- | purgatory/arch/ia64/purgatory-ia64.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/purgatory/arch/ia64/purgatory-ia64.c b/purgatory/arch/ia64/purgatory-ia64.c index eafb2d54..8004aab5 100644 --- a/purgatory/arch/ia64/purgatory-ia64.c +++ b/purgatory/arch/ia64/purgatory-ia64.c @@ -167,14 +167,9 @@ patch_efi_memmap(struct kexec_boot_params *params, continue; mstart = md1->phys_addr; mend = md1->phys_addr + (md1->num_pages << EFI_PAGE_SHIFT); - switch (md1->type) { - case EFI_LOADER_DATA: - *md2 = *md1; - md2->type = EFI_CONVENTIONAL_MEMORY; - break; - default: - *md2 = *md1; - } + *md2 = *md1; + if (md1->type == EFI_LOADER_DATA) + md2->type = EFI_CONVENTIONAL_MEMORY; // segments are already sorted and aligned to 4K orig_type = md2->type; for (i = 0; i < params->loaded_segments_num; i++) { |