qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"open list:Trivial patches" <qemu-trivial@nongnu.org>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	qemu-arm@nongnu.org
Subject: [PATCH 2/2] hw/sd/pxa2xx_mmci: Trivial simplification
Date: Sun,  5 Jul 2020 23:33:50 +0200	[thread overview]
Message-ID: <20200705213350.24725-3-f4bug@amsat.org> (raw)
In-Reply-To: <20200705213350.24725-1-f4bug@amsat.org>

Avoid declaring PXA2xxMMCIState local variable, return it directly.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/sd/pxa2xx_mmci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c
index 9482b9212d..2996a2ef17 100644
--- a/hw/sd/pxa2xx_mmci.c
+++ b/hw/sd/pxa2xx_mmci.c
@@ -480,10 +480,8 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
 {
     DeviceState *dev;
     SysBusDevice *sbd;
-    PXA2xxMMCIState *s;
 
     dev = qdev_new(TYPE_PXA2XX_MMCI);
-    s = PXA2XX_MMCI(dev);
     sbd = SYS_BUS_DEVICE(dev);
     sysbus_mmio_map(sbd, 0, base);
     sysbus_connect_irq(sbd, 0, irq);
@@ -491,7 +489,7 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
     qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma);
     sysbus_realize_and_unref(sbd, &error_fatal);
 
-    return s;
+    return PXA2XX_MMCI(dev);
 }
 
 static void pxa2xx_mmci_set_inserted(DeviceState *dev, bool inserted)
-- 
2.21.3



  parent reply	other threads:[~2020-07-05 21:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 21:33 [PATCH 0/2] hw/sd/pxa2xx_mmci: Do not create SD card within the SDHCI controller Philippe Mathieu-Daudé
2020-07-05 21:33 ` [PATCH 1/2] " Philippe Mathieu-Daudé
2020-07-06 16:38   ` Alistair Francis
2020-07-09 18:43   ` Peter Maydell
2020-07-05 21:33 ` Philippe Mathieu-Daudé [this message]
2020-07-06 16:39   ` [PATCH 2/2] hw/sd/pxa2xx_mmci: Trivial simplification Alistair Francis
2020-07-06 17:08   ` Laurent Vivier
2020-07-09 18:45 ` [PATCH 0/2] hw/sd/pxa2xx_mmci: Do not create SD card within the SDHCI controller Peter Maydell

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=20200705213350.24725-3-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=alistair@alistair23.me \
    --cc=laurent@vivier.eu \
    --cc=mjt@tls.msk.ru \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 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).