[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] hw/sd/pxa2xx_mmci: Trivial simplification
From: |
Alistair Francis |
Subject: |
Re: [PATCH 2/2] hw/sd/pxa2xx_mmci: Trivial simplification |
Date: |
Mon, 6 Jul 2020 09:39:25 -0700 |
On Sun, Jul 5, 2020 at 2:35 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Avoid declaring PXA2xxMMCIState local variable, return it directly.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> 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
>
>