All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: peter.maydell@linaro.org, qemu-devel@nongnu.org
Cc: "Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PULL 10/10] hw/pci-host/sabre: Simplify code initializing variable once
Date: Wed, 28 Oct 2020 08:23:58 +0000	[thread overview]
Message-ID: <20201028082358.23761-11-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20201028082358.23761-1-mark.cave-ayland@ilande.co.uk>

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

We only need to zero-initialize 'val' once.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20201012170950.3491912-4-f4bug@amsat.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/pci-host/sabre.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c
index f678a3eefc..f41a0cc301 100644
--- a/hw/pci-host/sabre.c
+++ b/hw/pci-host/sabre.c
@@ -195,32 +195,25 @@ static uint64_t sabre_config_read(void *opaque,
                                   hwaddr addr, unsigned size)
 {
     SabreState *s = opaque;
-    uint32_t val;
+    uint32_t val = 0;
 
     switch (addr) {
     case 0x30 ... 0x4f: /* DMA error registers */
-        val = 0;
         /* XXX: not implemented yet */
         break;
     case 0xc00 ... 0xc3f: /* PCI interrupt control */
         if (addr & 4) {
             val = s->pci_irq_map[(addr & 0x3f) >> 3];
-        } else {
-            val = 0;
         }
         break;
     case 0x1000 ... 0x107f: /* OBIO interrupt control */
         if (addr & 4) {
             val = s->obio_irq_map[(addr & 0xff) >> 3];
-        } else {
-            val = 0;
         }
         break;
     case 0x1080 ... 0x108f: /* PCI bus error */
         if (addr & 4) {
             val = s->pci_err_irq_map[(addr & 0xf) >> 3];
-        } else {
-            val = 0;
         }
         break;
     case 0x2000 ... 0x202f: /* PCI control */
@@ -229,8 +222,6 @@ static uint64_t sabre_config_read(void *opaque,
     case 0xf020 ... 0xf027: /* Reset control */
         if (addr & 4) {
             val = s->reset_control;
-        } else {
-            val = 0;
         }
         break;
     case 0x5000 ... 0x51cf: /* PIO/DMA diagnostics */
@@ -239,7 +230,6 @@ static uint64_t sabre_config_read(void *opaque,
     case 0xf000 ... 0xf01f: /* FFB config, memory control */
         /* we don't care */
     default:
-        val = 0;
         break;
     }
     trace_sabre_config_read(addr, val);
-- 
2.20.1



  parent reply	other threads:[~2020-10-28  8:34 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  8:23 [PULL 00/10] qemu-sparc queue 20201028 Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 01/10] sparc32-dma: use object_initialize_child() for espdma and ledma child objects Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 02/10] sparc32-ledma: use object_initialize_child() for lance child object Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 03/10] sparc32-espdma: use object_initialize_child() for esp " Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 04/10] sparc32-ledma: don't reference nd_table directly within the device Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 05/10] sabre: don't call sysbus_mmio_map() in sabre_realize() Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 06/10] hw/display/tcx: Allow 64-bit accesses to framebuffer stippler and blitter Mark Cave-Ayland
2020-10-28  8:23   ` [Bug 1892540] " Mark Cave-Ayland
2020-11-20 16:16   ` Philippe Mathieu-Daudé
2020-10-28  8:23 ` [PULL 07/10] sabre: increase number of PCI bus IRQs from 32 to 64 Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 08/10] hw/pci-host/sabre: Update documentation link Mark Cave-Ayland
2020-10-28  8:23 ` [PULL 09/10] hw/pci-host/sabre: Remove superfluous address range check Mark Cave-Ayland
2020-10-28  8:23 ` Mark Cave-Ayland [this message]
2020-10-31 14:42 ` [PULL 00/10] qemu-sparc queue 20201028 Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2020-11-20  8:17 [PATCH for-5.2] hw/display/tcx: add missing 64-bit access for framebuffer blitter Mark Cave-Ayland
2020-11-20  8:17 ` [Bug 1892540] " Mark Cave-Ayland
2020-11-20 10:18 ` Philippe Mathieu-Daudé
2020-11-20 10:18   ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-11-23  8:14 ` Mark Cave-Ayland
2020-11-23  8:14   ` [Bug 1892540] " Mark Cave-Ayland
2020-10-24 20:51 [PATCH v3] hw/display/tcx: Allow 64-bit accesses to framebuffer stippler and blitter Philippe Mathieu-Daudé
2020-10-24 20:51 ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-10-25 10:55 ` Mark Cave-Ayland
2020-10-25 10:55   ` [Bug 1892540] " Mark Cave-Ayland
2020-10-25 11:42   ` Philippe Mathieu-Daudé
2020-10-25 11:42     ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-08-22 14:15 [RFC PATCH] " Philippe Mathieu-Daudé
2020-08-22 14:15 ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-08-21 19:15 [Bug 1892540] [NEW] qemu can no longer boot NetBSD/sparc Andreas Gustafsson
2020-08-22 10:50 ` [Bug 1892540] " Laurent Vivier
2020-08-22 14:21 ` [RFC PATCH v2] hw/display/tcx: Allow 64-bit accesses to framebuffer stippler and blitter Philippe Mathieu-Daudé
2020-08-22 14:21   ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-08-29 15:41   ` Richard Henderson
2020-08-29 16:13     ` Michael
2020-08-29 16:45       ` Philippe Mathieu-Daudé
2020-08-29 16:45         ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-08-29 21:04         ` Michael
2020-08-30  7:32         ` Mark Cave-Ayland
2020-08-30  7:32           ` [Bug 1892540] " Mark Cave-Ayland
2020-10-24 20:53           ` Philippe Mathieu-Daudé
2020-10-24 20:53             ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-08-30  6:18   ` [Bug 1892540] " mst
2020-08-30  6:18     ` mst
2020-08-30  6:18     ` mst
2020-09-01 10:04     ` Philippe Mathieu-Daudé
2020-09-01 10:04       ` Philippe Mathieu-Daudé
2020-09-01 10:04       ` Philippe Mathieu-Daudé
2020-08-30  6:59   ` Andreas Gustafsson
2020-08-30  6:59     ` [Bug 1892540] " Andreas Gustafsson
2020-09-01 10:03     ` Philippe Mathieu-Daudé
2020-09-01 10:03       ` [Bug 1892540] " Philippe Mathieu-Daudé
2020-09-01 10:04       ` Andreas Gustafsson
2020-09-01 10:04         ` [Bug 1892540] " Andreas Gustafsson
2020-10-21  9:25         ` Mark Cave-Ayland
2020-10-21  9:25           ` [Bug 1892540] " Mark Cave-Ayland
2020-08-22 14:36 ` [Bug 1892540] Re: qemu can no longer boot NetBSD/sparc Philippe Mathieu-Daudé
2020-11-21 23:46 ` Peter Maydell
2020-11-22 11:05   ` Mark Cave-Ayland
2020-11-22 11:05     ` Mark Cave-Ayland
2020-11-23 11:39   ` mst
2020-11-23  8:20 ` Mark Cave-Ayland
2020-12-10  8:42 ` Thomas Huth

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=20201028082358.23761-11-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.