All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn
@ 2023-01-06 11:39 Bernhard Beschow
  2023-01-06 11:57 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bernhard Beschow @ 2023-01-06 11:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, BALATON Zoltan, Bernhard Beschow

mv64361_pcihost_map_irq() is a reimplementation of
pci_swizzle_map_irq_fn(). Resolve this redundancy.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
Testing done:
* `qemu-system-ppc -machine pegasos2 \
                   -rtc base=localtime \
                   -device ati-vga,guest_hwcursor=true,romfile="" \
                   -cdrom morphos-3.17.iso \
                   -kernel morphos-3.17/boot.img`
---
 hw/pci-host/mv64361.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
index cc9c4d6d3b..70db142ec3 100644
--- a/hw/pci-host/mv64361.c
+++ b/hw/pci-host/mv64361.c
@@ -72,11 +72,6 @@ struct MV64361PCIState {
     uint64_t remap[5];
 };
 
-static int mv64361_pcihost_map_irq(PCIDevice *pci_dev, int n)
-{
-    return (n + PCI_SLOT(pci_dev->devfn)) % PCI_NUM_PINS;
-}
-
 static void mv64361_pcihost_set_irq(void *opaque, int n, int level)
 {
     MV64361PCIState *s = opaque;
@@ -97,7 +92,7 @@ static void mv64361_pcihost_realize(DeviceState *dev, Error **errp)
     g_free(name);
     name = g_strdup_printf("pci.%d", s->index);
     h->bus = pci_register_root_bus(dev, name, mv64361_pcihost_set_irq,
-                                   mv64361_pcihost_map_irq, dev,
+                                   pci_swizzle_map_irq_fn, dev,
                                    &s->mem, &s->io, 0, 4, TYPE_PCI_BUS);
     g_free(name);
     pci_create_simple(h->bus, 0, TYPE_MV64361_PCI_BRIDGE);
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn
  2023-01-06 11:39 [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn Bernhard Beschow
@ 2023-01-06 11:57 ` Philippe Mathieu-Daudé
  2023-01-06 15:32 ` BALATON Zoltan
  2023-01-21 20:56 ` Bernhard Beschow
  2 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-01-06 11:57 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel; +Cc: qemu-ppc, BALATON Zoltan

On 6/1/23 12:39, Bernhard Beschow wrote:
> mv64361_pcihost_map_irq() is a reimplementation of
> pci_swizzle_map_irq_fn(). Resolve this redundancy.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> Testing done:
> * `qemu-system-ppc -machine pegasos2 \
>                     -rtc base=localtime \
>                     -device ati-vga,guest_hwcursor=true,romfile="" \
>                     -cdrom morphos-3.17.iso \
>                     -kernel morphos-3.17/boot.img`
> ---
>   hw/pci-host/mv64361.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn
  2023-01-06 11:39 [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn Bernhard Beschow
  2023-01-06 11:57 ` Philippe Mathieu-Daudé
@ 2023-01-06 15:32 ` BALATON Zoltan
  2023-01-21 20:56 ` Bernhard Beschow
  2 siblings, 0 replies; 5+ messages in thread
From: BALATON Zoltan @ 2023-01-06 15:32 UTC (permalink / raw)
  To: Bernhard Beschow; +Cc: qemu-devel, qemu-ppc

On Fri, 6 Jan 2023, Bernhard Beschow wrote:
> mv64361_pcihost_map_irq() is a reimplementation of
> pci_swizzle_map_irq_fn(). Resolve this redundancy.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>

Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>

> ---
> Testing done:
> * `qemu-system-ppc -machine pegasos2 \
>                   -rtc base=localtime \
>                   -device ati-vga,guest_hwcursor=true,romfile="" \
>                   -cdrom morphos-3.17.iso \
>                   -kernel morphos-3.17/boot.img`
> ---
> hw/pci-host/mv64361.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
> index cc9c4d6d3b..70db142ec3 100644
> --- a/hw/pci-host/mv64361.c
> +++ b/hw/pci-host/mv64361.c
> @@ -72,11 +72,6 @@ struct MV64361PCIState {
>     uint64_t remap[5];
> };
>
> -static int mv64361_pcihost_map_irq(PCIDevice *pci_dev, int n)
> -{
> -    return (n + PCI_SLOT(pci_dev->devfn)) % PCI_NUM_PINS;
> -}
> -
> static void mv64361_pcihost_set_irq(void *opaque, int n, int level)
> {
>     MV64361PCIState *s = opaque;
> @@ -97,7 +92,7 @@ static void mv64361_pcihost_realize(DeviceState *dev, Error **errp)
>     g_free(name);
>     name = g_strdup_printf("pci.%d", s->index);
>     h->bus = pci_register_root_bus(dev, name, mv64361_pcihost_set_irq,
> -                                   mv64361_pcihost_map_irq, dev,
> +                                   pci_swizzle_map_irq_fn, dev,
>                                    &s->mem, &s->io, 0, 4, TYPE_PCI_BUS);
>     g_free(name);
>     pci_create_simple(h->bus, 0, TYPE_MV64361_PCI_BRIDGE);
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn
  2023-01-06 11:39 [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn Bernhard Beschow
  2023-01-06 11:57 ` Philippe Mathieu-Daudé
  2023-01-06 15:32 ` BALATON Zoltan
@ 2023-01-21 20:56 ` Bernhard Beschow
  2023-01-24 19:22   ` Daniel Henrique Barboza
  2 siblings, 1 reply; 5+ messages in thread
From: Bernhard Beschow @ 2023-01-21 20:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, BALATON Zoltan



Am 6. Januar 2023 11:39:27 UTC schrieb Bernhard Beschow <shentey@gmail.com>:
>mv64361_pcihost_map_irq() is a reimplementation of
>pci_swizzle_map_irq_fn(). Resolve this redundancy.
>
>Signed-off-by: Bernhard Beschow <shentey@gmail.com>

Ping

Patch is reviewed. Who will queue it? Daniel?

Best regards,
Bernhard

>---
>Testing done:
>* `qemu-system-ppc -machine pegasos2 \
>                   -rtc base=localtime \
>                   -device ati-vga,guest_hwcursor=true,romfile="" \
>                   -cdrom morphos-3.17.iso \
>                   -kernel morphos-3.17/boot.img`
>---
> hw/pci-host/mv64361.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
>diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
>index cc9c4d6d3b..70db142ec3 100644
>--- a/hw/pci-host/mv64361.c
>+++ b/hw/pci-host/mv64361.c
>@@ -72,11 +72,6 @@ struct MV64361PCIState {
>     uint64_t remap[5];
> };
> 
>-static int mv64361_pcihost_map_irq(PCIDevice *pci_dev, int n)
>-{
>-    return (n + PCI_SLOT(pci_dev->devfn)) % PCI_NUM_PINS;
>-}
>-
> static void mv64361_pcihost_set_irq(void *opaque, int n, int level)
> {
>     MV64361PCIState *s = opaque;
>@@ -97,7 +92,7 @@ static void mv64361_pcihost_realize(DeviceState *dev, Error **errp)
>     g_free(name);
>     name = g_strdup_printf("pci.%d", s->index);
>     h->bus = pci_register_root_bus(dev, name, mv64361_pcihost_set_irq,
>-                                   mv64361_pcihost_map_irq, dev,
>+                                   pci_swizzle_map_irq_fn, dev,
>                                    &s->mem, &s->io, 0, 4, TYPE_PCI_BUS);
>     g_free(name);
>     pci_create_simple(h->bus, 0, TYPE_MV64361_PCI_BRIDGE);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn
  2023-01-21 20:56 ` Bernhard Beschow
@ 2023-01-24 19:22   ` Daniel Henrique Barboza
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Henrique Barboza @ 2023-01-24 19:22 UTC (permalink / raw)
  To: Bernhard Beschow, qemu-devel; +Cc: qemu-ppc, BALATON Zoltan



On 1/21/23 17:56, Bernhard Beschow wrote:
> 
> 
> Am 6. Januar 2023 11:39:27 UTC schrieb Bernhard Beschow <shentey@gmail.com>:
>> mv64361_pcihost_map_irq() is a reimplementation of
>> pci_swizzle_map_irq_fn(). Resolve this redundancy.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> 
> Ping
> 
> Patch is reviewed. Who will queue it? Daniel?

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

> 
> Best regards,
> Bernhard
> 
>> ---
>> Testing done:
>> * `qemu-system-ppc -machine pegasos2 \
>>                    -rtc base=localtime \
>>                    -device ati-vga,guest_hwcursor=true,romfile="" \
>>                    -cdrom morphos-3.17.iso \
>>                    -kernel morphos-3.17/boot.img`
>> ---
>> hw/pci-host/mv64361.c | 7 +------
>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
>> index cc9c4d6d3b..70db142ec3 100644
>> --- a/hw/pci-host/mv64361.c
>> +++ b/hw/pci-host/mv64361.c
>> @@ -72,11 +72,6 @@ struct MV64361PCIState {
>>      uint64_t remap[5];
>> };
>>
>> -static int mv64361_pcihost_map_irq(PCIDevice *pci_dev, int n)
>> -{
>> -    return (n + PCI_SLOT(pci_dev->devfn)) % PCI_NUM_PINS;
>> -}
>> -
>> static void mv64361_pcihost_set_irq(void *opaque, int n, int level)
>> {
>>      MV64361PCIState *s = opaque;
>> @@ -97,7 +92,7 @@ static void mv64361_pcihost_realize(DeviceState *dev, Error **errp)
>>      g_free(name);
>>      name = g_strdup_printf("pci.%d", s->index);
>>      h->bus = pci_register_root_bus(dev, name, mv64361_pcihost_set_irq,
>> -                                   mv64361_pcihost_map_irq, dev,
>> +                                   pci_swizzle_map_irq_fn, dev,
>>                                     &s->mem, &s->io, 0, 4, TYPE_PCI_BUS);
>>      g_free(name);
>>      pci_create_simple(h->bus, 0, TYPE_MV64361_PCI_BRIDGE);
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-24 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 11:39 [PATCH] hw/pci-host/mv64361: Reuse pci_swizzle_map_irq_fn Bernhard Beschow
2023-01-06 11:57 ` Philippe Mathieu-Daudé
2023-01-06 15:32 ` BALATON Zoltan
2023-01-21 20:56 ` Bernhard Beschow
2023-01-24 19:22   ` Daniel Henrique Barboza

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.