All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mv64361: Remove extra break from a switch case
@ 2021-07-12 13:11 BALATON Zoltan
  2021-07-12 14:17 ` Philippe Mathieu-Daudé
  2021-07-13  0:12 ` David Gibson
  0 siblings, 2 replies; 4+ messages in thread
From: BALATON Zoltan @ 2021-07-12 13:11 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: Greg Kurz, David Gibson

The switch case of writing PCI 1 IO base address had an extra break
statement that made part of the code unreachable. This did not cause a
problem as guests ususally leave this register at its default value.

Reported-by: Coverity (CID 1458135)
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/pci-host/mv64361.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
index 20510d8680..92b0f5d047 100644
--- a/hw/pci-host/mv64361.c
+++ b/hw/pci-host/mv64361.c
@@ -687,7 +687,6 @@ static void mv64361_write(void *opaque, hwaddr addr, uint64_t val,
     case MV64340_PCI_1_IO_BASE_ADDR:
         s->pci[1].io_base = val & 0x30fffffULL;
         warn_swap_bit(val);
-        break;
         if (!(s->cpu_conf & BIT(27))) {
             s->pci[1].remap[4] = (val & 0xffffULL) << 16;
         }
-- 
2.21.4



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

* Re: [PATCH] mv64361: Remove extra break from a switch case
  2021-07-12 13:11 [PATCH] mv64361: Remove extra break from a switch case BALATON Zoltan
@ 2021-07-12 14:17 ` Philippe Mathieu-Daudé
  2021-07-12 14:38   ` BALATON Zoltan
  2021-07-13  0:12 ` David Gibson
  1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-07-12 14:17 UTC (permalink / raw)
  To: BALATON Zoltan, qemu-devel, qemu-ppc; +Cc: Greg Kurz, David Gibson

On 7/12/21 3:11 PM, BALATON Zoltan wrote:
> The switch case of writing PCI 1 IO base address had an extra break
> statement that made part of the code unreachable. This did not cause a
> problem as guests ususally leave this register at its default value.
> 
> Reported-by: Coverity (CID 1458135)

Fixes: dcdf98a9015 ("Add emulation of Marvell MV64361 PPC system
controller")
?

> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>  hw/pci-host/mv64361.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
> index 20510d8680..92b0f5d047 100644
> --- a/hw/pci-host/mv64361.c
> +++ b/hw/pci-host/mv64361.c
> @@ -687,7 +687,6 @@ static void mv64361_write(void *opaque, hwaddr addr, uint64_t val,
>      case MV64340_PCI_1_IO_BASE_ADDR:
>          s->pci[1].io_base = val & 0x30fffffULL;
>          warn_swap_bit(val);
> -        break;
>          if (!(s->cpu_conf & BIT(27))) {
>              s->pci[1].remap[4] = (val & 0xffffULL) << 16;
>          }
> 



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

* Re: [PATCH] mv64361: Remove extra break from a switch case
  2021-07-12 14:17 ` Philippe Mathieu-Daudé
@ 2021-07-12 14:38   ` BALATON Zoltan
  0 siblings, 0 replies; 4+ messages in thread
From: BALATON Zoltan @ 2021-07-12 14:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: David Gibson, qemu-ppc, qemu-devel, Greg Kurz

[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]

On Mon, 12 Jul 2021, Philippe Mathieu-Daudé wrote:
> On 7/12/21 3:11 PM, BALATON Zoltan wrote:
>> The switch case of writing PCI 1 IO base address had an extra break
>> statement that made part of the code unreachable. This did not cause a
>> problem as guests ususally leave this register at its default value.
>>
>> Reported-by: Coverity (CID 1458135)
>
> Fixes: dcdf98a9015 ("Add emulation of Marvell MV64361 PPC system
> controller")
> ?

Yeah, why not. Feel free to add the Fixes tag when merging, although 
that's the only commit this file had so far so linking to it does not seem 
to add much more info.

Regards,
BALATON Zoltan

>> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
>> ---
>>  hw/pci-host/mv64361.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
>> index 20510d8680..92b0f5d047 100644
>> --- a/hw/pci-host/mv64361.c
>> +++ b/hw/pci-host/mv64361.c
>> @@ -687,7 +687,6 @@ static void mv64361_write(void *opaque, hwaddr addr, uint64_t val,
>>      case MV64340_PCI_1_IO_BASE_ADDR:
>>          s->pci[1].io_base = val & 0x30fffffULL;
>>          warn_swap_bit(val);
>> -        break;
>>          if (!(s->cpu_conf & BIT(27))) {
>>              s->pci[1].remap[4] = (val & 0xffffULL) << 16;
>>          }
>>
>
>

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

* Re: [PATCH] mv64361: Remove extra break from a switch case
  2021-07-12 13:11 [PATCH] mv64361: Remove extra break from a switch case BALATON Zoltan
  2021-07-12 14:17 ` Philippe Mathieu-Daudé
@ 2021-07-13  0:12 ` David Gibson
  1 sibling, 0 replies; 4+ messages in thread
From: David Gibson @ 2021-07-13  0:12 UTC (permalink / raw)
  To: BALATON Zoltan; +Cc: qemu-ppc, qemu-devel, Greg Kurz

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

On Mon, Jul 12, 2021 at 03:11:01PM +0200, BALATON Zoltan wrote:
> The switch case of writing PCI 1 IO base address had an extra break
> statement that made part of the code unreachable. This did not cause a
> problem as guests ususally leave this register at its default value.
> 
> Reported-by: Coverity (CID 1458135)
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

Applied to ppc-for-6.1, thanks.

> ---
>  hw/pci-host/mv64361.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c
> index 20510d8680..92b0f5d047 100644
> --- a/hw/pci-host/mv64361.c
> +++ b/hw/pci-host/mv64361.c
> @@ -687,7 +687,6 @@ static void mv64361_write(void *opaque, hwaddr addr, uint64_t val,
>      case MV64340_PCI_1_IO_BASE_ADDR:
>          s->pci[1].io_base = val & 0x30fffffULL;
>          warn_swap_bit(val);
> -        break;
>          if (!(s->cpu_conf & BIT(27))) {
>              s->pci[1].remap[4] = (val & 0xffffULL) << 16;
>          }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-07-13  1:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 13:11 [PATCH] mv64361: Remove extra break from a switch case BALATON Zoltan
2021-07-12 14:17 ` Philippe Mathieu-Daudé
2021-07-12 14:38   ` BALATON Zoltan
2021-07-13  0:12 ` David Gibson

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.