[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.0 v2 05/11] hw/ide/sii3112: Remove dead assignment
From: |
John Snow |
Subject: |
Re: [PATCH-for-5.0 v2 05/11] hw/ide/sii3112: Remove dead assignment |
Date: |
Mon, 23 Mar 2020 14:46:14 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/21/20 10:41 AM, Philippe Mathieu-Daudé wrote:
> Fix warning reported by Clang static code analyzer:
>
> CC hw/ide/sii3112.o
> hw/ide/sii3112.c:204:9: warning: Value stored to 'val' is never read
> val = 0;
> ^ ~
>
> Fixes: a9dd6604
> Reported-by: Clang Static Analyzer
> Reviewed-by: BALATON Zoltan <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> v2: Fix the correct function (Aleksandar review)
> ---
> hw/ide/sii3112.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ide/sii3112.c b/hw/ide/sii3112.c
> index 06605d7af2..b2ff6dd6d9 100644
> --- a/hw/ide/sii3112.c
> +++ b/hw/ide/sii3112.c
> @@ -42,7 +42,7 @@ static uint64_t sii3112_reg_read(void *opaque, hwaddr addr,
> unsigned int size)
> {
> SiI3112PCIState *d = opaque;
> - uint64_t val = 0;
> + uint64_t val;
>
> switch (addr) {
> case 0x00:
> @@ -126,6 +126,7 @@ static uint64_t sii3112_reg_read(void *opaque, hwaddr
> addr,
> break;
> default:
> val = 0;
> + break;
> }
> trace_sii3112_read(size, addr, val);
> return val;
> @@ -201,7 +202,7 @@ static void sii3112_reg_write(void *opaque, hwaddr addr,
> d->regs[1].sien = (val >> 16) & 0x3eed;
> break;
> default:
> - val = 0;
> + break;
> }
> }
>
>
Acked-by: John Snow <address@hidden>
- [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 01/11] block: Avoid dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 02/11] blockdev: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 03/11] hw/i2c/pm_smbus: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 04/11] hw/input/adb-kbd: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 05/11] hw/ide/sii3112: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- Re: [PATCH-for-5.0 v2 05/11] hw/ide/sii3112: Remove dead assignment,
John Snow <=
- [PATCH-for-5.0 v2 06/11] hw/isa/i82378: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 07/11] hw/gpio/aspeed_gpio: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 08/11] hw/timer/exynos4210_mct: Remove dead assignments, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 09/11] hw/timer/stm32f2xx_timer: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- [PATCH-for-5.0 v2 10/11] hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning, Philippe Mathieu-Daudé, 2020/03/21