Skip to contentSkip to conversation

stm32f4xx_syscfg: remove redundant code to fix coverity warning

PATCH In review [email protected] 2 participants 2 messages Jan 23, 2020 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stm32f4xx_syscfg: remove redundant code to fix coverity warning

From: Pan Nengyuan <[email protected]>

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;
---
 hw/misc/stm32f4xx_syscfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/stm32f4xx_syscfg.c +1 -1
index dbcdca59f8..f960e4ea1e 100644
@@ -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);
 
Signature · 1 line
2.21.0.windows.1
#1 lore raw
Quoted 18 lines · On 23/01/2020 03.38, [email protected] wrote:

From: Pan Nengyuan <[email protected]>

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;
---
 hw/misc/stm32f4xx_syscfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/stm32f4xx_syscfg.c +0 -0
index dbcdca59f8..f960e4ea1e 100644

hw/misc/stm32f4xx_syscfg.c static void stm32f4xx_syscfg_set_irq(void *opaque, int irq, int level) · line 50

Quoted 5 lines
hw/misc/stm32f4xx_syscfg.c +1 -1
@@ -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