diff options
| author | Peter Crosthwaite | 2015-08-18 06:53:16 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2015-09-25 12:04:43 +0200 |
| commit | 7cc472218c807ef85714ec71b161c39ee29d634e (patch) | |
| tree | 7d17ffca2ab6827b3b69ea39ef191ffeaad715ca | |
| parent | linux-user: elfload: Provide default for elf_check_arch (diff) | |
| download | qemu-7cc472218c807ef85714ec71b161c39ee29d634e.tar.gz qemu-7cc472218c807ef85714ec71b161c39ee29d634e.tar.xz qemu-7cc472218c807ef85714ec71b161c39ee29d634e.zip | |
elf_ops: Fix coding style for EM alias case statement
Fix the coding style for these cases as per CODING_STYLE. Reverse the
Yoda conditions and add missing if braces.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | include/hw/elf_ops.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index bd71968143..0d41f249a0 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -282,25 +282,28 @@ static int glue(load_elf, SZ)(const char *name, int fd, switch (elf_machine) { case EM_PPC64: - if (EM_PPC64 != ehdr.e_machine) - if (EM_PPC != ehdr.e_machine) { + if (ehdr.e_machine != EM_PPC64) { + if (ehdr.e_machine != EM_PPC) { ret = ELF_LOAD_WRONG_ARCH; goto fail; } + } break; case EM_X86_64: - if (EM_X86_64 != ehdr.e_machine) - if (EM_386 != ehdr.e_machine) { + if (ehdr.e_machine != EM_X86_64) { + if (ehdr.e_machine != EM_386) { ret = ELF_LOAD_WRONG_ARCH; goto fail; } + } break; case EM_MICROBLAZE: - if (EM_MICROBLAZE != ehdr.e_machine) - if (EM_MICROBLAZE_OLD != ehdr.e_machine) { + if (ehdr.e_machine != EM_MICROBLAZE) { + if (ehdr.e_machine != EM_MICROBLAZE_OLD) { ret = ELF_LOAD_WRONG_ARCH; goto fail; } + } break; default: if (elf_machine != ehdr.e_machine) { |
