qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: [PULL 02/11] disas/nios2: Fix style in print_insn_nios2()
Date: Sat, 23 Oct 2021 20:31:14 +0200	[thread overview]
Message-ID: <20211023183123.813116-3-laurent@vivier.eu> (raw)
In-Reply-To: <20211023183123.813116-1-laurent@vivier.eu>

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

We are going to modify this function, fix its style first.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210807110939.95853-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 disas/nios2.c | 55 +++++++++++++++++++++++++--------------------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/disas/nios2.c b/disas/nios2.c
index c3e82140c798..d124902ae3e1 100644
--- a/disas/nios2.c
+++ b/disas/nios2.c
@@ -3482,38 +3482,37 @@ static int
 print_insn_nios2 (bfd_vma address, disassemble_info *info,
 		  enum bfd_endian endianness)
 {
-  bfd_byte buffer[INSNLEN];
-  int status;
-
-  status = (*info->read_memory_func) (address, buffer, INSNLEN, info);
-  if (status == 0)
-    {
-      unsigned long insn;
-      if (endianness == BFD_ENDIAN_BIG)
-	insn = (unsigned long) bfd_getb32 (buffer);
-      else
-	insn = (unsigned long) bfd_getl32 (buffer);
-      return nios2_disassemble (address, insn, info);
+    bfd_byte buffer[INSNLEN];
+    int status;
+
+    status = (*info->read_memory_func)(address, buffer, INSNLEN, info);
+    if (status == 0) {
+        unsigned long insn;
+        if (endianness == BFD_ENDIAN_BIG) {
+            insn = (unsigned long) bfd_getb32(buffer);
+        } else {
+            insn = (unsigned long) bfd_getl32(buffer);
+        }
+        return nios2_disassemble(address, insn, info);
     }
 
-  /* We might have a 16-bit R2 instruction at the end of memory.  Try that.  */
-  if (info->mach == bfd_mach_nios2r2)
-    {
-      status = (*info->read_memory_func) (address, buffer, 2, info);
-      if (status == 0)
-	{
-	  unsigned long insn;
-	  if (endianness == BFD_ENDIAN_BIG)
-	    insn = (unsigned long) bfd_getb16 (buffer);
-	  else
-	    insn = (unsigned long) bfd_getl16 (buffer);
-	  return nios2_disassemble (address, insn, info);
-	}
+    /* We might have a 16-bit R2 instruction at the end of memory. Try that. */
+    if (info->mach == bfd_mach_nios2r2) {
+        status = (*info->read_memory_func)(address, buffer, 2, info);
+        if (status == 0) {
+            unsigned long insn;
+            if (endianness == BFD_ENDIAN_BIG) {
+                insn = (unsigned long) bfd_getb16(buffer);
+            } else {
+                insn = (unsigned long) bfd_getl16(buffer);
+            }
+            return nios2_disassemble(address, insn, info);
+        }
     }
 
-  /* If we got here, we couldn't read anything.  */
-  (*info->memory_error_func) (status, address, info);
-  return -1;
+    /* If we got here, we couldn't read anything.  */
+    (*info->memory_error_func)(status, address, info);
+    return -1;
 }
 
 /* These two functions are the main entry points, accessed from
-- 
2.31.1



  parent reply	other threads:[~2021-10-23 18:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23 18:31 [PULL 00/11] Trivial branch for 6.2 patches Laurent Vivier
2021-10-23 18:31 ` [PULL 01/11] po: update turkish translation Laurent Vivier
2021-10-23 18:31 ` Laurent Vivier [this message]
2021-10-23 18:31 ` [PULL 03/11] disas/nios2: Simplify endianess conversion Laurent Vivier
2021-10-23 18:31 ` [PULL 04/11] MAINTAINERS: Add myself as reviewer of 'Machine core' API Laurent Vivier
2021-10-23 18:31 ` [PULL 05/11] softmmu/physmem.c: Fix typo in comment Laurent Vivier
2021-10-23 18:31 ` [PULL 06/11] hw/nvram: Fix Memory Leak in Xilinx eFuse QOM Laurent Vivier
2021-10-23 18:31 ` [PULL 07/11] hw/nvram: Fix Memory Leak in Xilinx Versal eFuse device Laurent Vivier
2021-10-23 18:31 ` [PULL 08/11] hw/nvram: Fix Memory Leak in Xilinx ZynqMP " Laurent Vivier
2021-10-23 18:31 ` [PULL 09/11] README: Fix some documentation URLs Laurent Vivier
2021-10-23 18:31 ` [PULL 10/11] analyze-migration.py: fix a long standing typo Laurent Vivier
2021-10-23 18:31 ` [PULL 11/11] analyze-migration.py: fix extract contents ('-x') errors Laurent Vivier
2021-10-23 23:22 ` [PULL 00/11] Trivial branch for 6.2 patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211023183123.813116-3-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    --subject='Re: [PULL 02/11] disas/nios2: Fix style in print_insn_nios2()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).