[PATCH] hw/misc/stm32f4xx_syscfg: Fix copy/paste error

Philippe Mathieu-Daudé posted 1 patch 4 years, 3 months ago
Test FreeBSD passed
Test docker-mingw@fedora passed
Test checkpatch passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200121213853.9601-1-f4bug@amsat.org
hw/misc/stm32f4xx_syscfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hw/misc/stm32f4xx_syscfg: Fix copy/paste error
Posted by Philippe Mathieu-Daudé 4 years, 3 months ago
Missed in 870c034da0b, hopefully reported by Coverity.

Fixes: Coverity CID 1412793 (Incorrect expression)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 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.1


Re: [PATCH] hw/misc/stm32f4xx_syscfg: Fix copy/paste error
Posted by Alistair Francis 4 years, 3 months ago
On Wed, Jan 22, 2020 at 7:39 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Missed in 870c034da0b, hopefully reported by Coverity.
>
> Fixes: Coverity CID 1412793 (Incorrect expression)
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

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

Re: [PATCH] hw/misc/stm32f4xx_syscfg: Fix copy/paste error
Posted by Alex Bennée 4 years, 3 months ago
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> Missed in 870c034da0b, hopefully reported by Coverity.
>
> Fixes: Coverity CID 1412793 (Incorrect expression)
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

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


-- 
Alex Bennée

Re: [PATCH] hw/misc/stm32f4xx_syscfg: Fix copy/paste error
Posted by Peter Maydell 4 years, 3 months ago
On Tue, 21 Jan 2020 at 21:38, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Missed in 870c034da0b, hopefully reported by Coverity.
>
> Fixes: Coverity CID 1412793 (Incorrect expression)
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  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);



Applied to target-arm.next, thanks.

-- PMM

Re: [PATCH] hw/misc/stm32f4xx_syscfg: Fix copy/paste error
Posted by Thomas Huth 4 years, 3 months ago
On 21/01/2020 22.38, Philippe Mathieu-Daudé wrote:
> Missed in 870c034da0b, hopefully reported by Coverity.
> 
> Fixes: Coverity CID 1412793 (Incorrect expression)
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  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);
>  
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>