summaryrefslogtreecommitdiffstats
path: root/purgatory
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2006-09-22 16:45:32 +0900
committerSimon Horman <horms@verge.net.au>2006-10-06 12:46:16 +0900
commitc506e2859d2b890bd6ada04fa11e434ba5d87b1e (patch)
tree132fb11abbaa2554515674b42678ea52d3691a1e /purgatory
parentef14c5794bed504f83d2a0721a88993f0c64099b (diff)
downloadkexec-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.c11
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++) {