提交 7cc47221 编写于 作者: P Peter Crosthwaite 提交者: Paolo Bonzini

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: NRichard Henderson <rth@twiddle.net>
Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 d276a604
...@@ -282,25 +282,28 @@ static int glue(load_elf, SZ)(const char *name, int fd, ...@@ -282,25 +282,28 @@ static int glue(load_elf, SZ)(const char *name, int fd,
switch (elf_machine) { switch (elf_machine) {
case EM_PPC64: case EM_PPC64:
if (EM_PPC64 != ehdr.e_machine) if (ehdr.e_machine != EM_PPC64) {
if (EM_PPC != ehdr.e_machine) { if (ehdr.e_machine != EM_PPC) {
ret = ELF_LOAD_WRONG_ARCH; ret = ELF_LOAD_WRONG_ARCH;
goto fail; goto fail;
} }
}
break; break;
case EM_X86_64: case EM_X86_64:
if (EM_X86_64 != ehdr.e_machine) if (ehdr.e_machine != EM_X86_64) {
if (EM_386 != ehdr.e_machine) { if (ehdr.e_machine != EM_386) {
ret = ELF_LOAD_WRONG_ARCH; ret = ELF_LOAD_WRONG_ARCH;
goto fail; goto fail;
} }
}
break; break;
case EM_MICROBLAZE: case EM_MICROBLAZE:
if (EM_MICROBLAZE != ehdr.e_machine) if (ehdr.e_machine != EM_MICROBLAZE) {
if (EM_MICROBLAZE_OLD != ehdr.e_machine) { if (ehdr.e_machine != EM_MICROBLAZE_OLD) {
ret = ELF_LOAD_WRONG_ARCH; ret = ELF_LOAD_WRONG_ARCH;
goto fail; goto fail;
} }
}
break; break;
default: default:
if (elf_machine != ehdr.e_machine) { if (elf_machine != ehdr.e_machine) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册