From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZePAJ-0002HP-Mu for qemu-devel@nongnu.org; Tue, 22 Sep 2015 11:07:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZePAF-0001BB-Pp for qemu-devel@nongnu.org; Tue, 22 Sep 2015 11:07:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZePAF-0001B1-CE for qemu-devel@nongnu.org; Tue, 22 Sep 2015 11:07:27 -0400 From: Paolo Bonzini Date: Tue, 22 Sep 2015 17:05:53 +0200 Message-Id: <1442934371-12567-31-git-send-email-pbonzini@redhat.com> In-Reply-To: <1442934371-12567-1-git-send-email-pbonzini@redhat.com> References: <1442934371-12567-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 30/48] elf_ops: Fix coding style for EM alias case statement List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite From: Peter Crosthwaite Fix the coding style for these cases as per CODING_STYLE. Reverse the Yoda conditions and add missing if braces. Reviewed-by: Richard Henderson Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- include/hw/elf_ops.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index bd71968..0d41f24 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) { -- 2.5.0