From c506e2859d2b890bd6ada04fa11e434ba5d87b1e Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 22 Sep 2006 16:45:32 +0900 Subject: 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 --- purgatory/arch/ia64/purgatory-ia64.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'purgatory/arch') diff --git a/purgatory/arch/ia64/purgatory-ia64.c b/purgatory/arch/ia64/purgatory-ia64.c index eafb2d5..8004aab 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++) { -- cgit