qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stm32f4xx_syscfg: remove redundant code to fix coverity warning
@ 2020-01-23  2:38 pannengyuan
  2020-01-23  5:26 ` Thomas Huth
  0 siblings, 1 reply; 2+ messages in thread
From: pannengyuan @ 2020-01-23  2:38 UTC (permalink / raw)
  To: alistair, peter.maydell
  Cc: qemu-trivial, Euler Robot, Pan Nengyuan, zhang.zhanghailiang,
	qemu-devel

From: Pan Nengyuan <pannengyuan@huawei.com>

Fixes the coverity warning:
    CID 91708242: (EVALUATION_ORDER)
    50. write_write_typo: In "config = config = irq / 16", "config" is written twice with the same value.
    50    uint8_t config = config = irq / 16;

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
---
 hw/misc/stm32f4xx_syscfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/misc/stm32f4xx_syscfg.c b/hw/misc/stm32f4xx_syscfg.c
index dbcdca59f8..f960e4ea1e 100644
--- a/hw/misc/stm32f4xx_syscfg.c
+++ b/hw/misc/stm32f4xx_syscfg.c
@@ -47,7 +47,7 @@ static void stm32f4xx_syscfg_set_irq(void *opaque, int irq, int level)
     STM32F4xxSyscfgState *s = opaque;
     int icrreg = irq / 4;
     int startbit = (irq & 3) * 4;
-    uint8_t config = config = irq / 16;
+    uint8_t config = irq / 16;
 
     trace_stm32f4xx_syscfg_set_irq(irq / 16, irq % 16, level);
 
-- 
2.21.0.windows.1




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

* Re: [PATCH] stm32f4xx_syscfg: remove redundant code to fix coverity warning
  2020-01-23  2:38 [PATCH] stm32f4xx_syscfg: remove redundant code to fix coverity warning pannengyuan
@ 2020-01-23  5:26 ` Thomas Huth
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2020-01-23  5:26 UTC (permalink / raw)
  To: pannengyuan, alistair, peter.maydell
  Cc: qemu-trivial, qemu-devel, Philippe Mathieu-Daudé,
	zhang.zhanghailiang, Euler Robot

On 23/01/2020 03.38, pannengyuan@huawei.com wrote:
> From: Pan Nengyuan <pannengyuan@huawei.com>
> 
> Fixes the coverity warning:
>     CID 91708242: (EVALUATION_ORDER)
>     50. write_write_typo: In "config = config = irq / 16", "config" is written twice with the same value.
>     50    uint8_t config = config = irq / 16;
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
> ---
>  hw/misc/stm32f4xx_syscfg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/misc/stm32f4xx_syscfg.c b/hw/misc/stm32f4xx_syscfg.c
> index dbcdca59f8..f960e4ea1e 100644
> --- a/hw/misc/stm32f4xx_syscfg.c
> +++ b/hw/misc/stm32f4xx_syscfg.c
> @@ -47,7 +47,7 @@ static void stm32f4xx_syscfg_set_irq(void *opaque, int irq, int level)
>      STM32F4xxSyscfgState *s = opaque;
>      int icrreg = irq / 4;
>      int startbit = (irq & 3) * 4;
> -    uint8_t config = config = irq / 16;
> +    uint8_t config = irq / 16;

Thanks, but Philippe already posted a patch for this :

https://lists.gnu.org/archive/html/qemu-devel/2020-01/msg04823.html

 Thomas



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

end of thread, other threads:[~2020-01-23  5:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-23  2:38 [PATCH] stm32f4xx_syscfg: remove redundant code to fix coverity warning pannengyuan
2020-01-23  5:26 ` Thomas Huth

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).