[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.0 v2 07/11] hw/gpio/aspeed_gpio: Remove dead assignment
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH-for-5.0 v2 07/11] hw/gpio/aspeed_gpio: Remove dead assignment |
Date: |
Sun, 22 Mar 2020 09:02:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 3/21/20 3:41 PM, Philippe Mathieu-Daudé wrote:
> Fix warning reported by Clang static code analyzer:
>
> hw/gpio/aspeed_gpio.c:717:18: warning: Value stored to 'g_idx' during its
> initialization is never read
> int set_idx, g_idx = *group_idx;
> ^~~~~ ~~~~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
> ---
> v2: Do not declare g_idx in for() (Zoltan)
> ---
> hw/gpio/aspeed_gpio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
> index 41e11ea9b0..bd19db31f4 100644
> --- a/hw/gpio/aspeed_gpio.c
> +++ b/hw/gpio/aspeed_gpio.c
> @@ -714,7 +714,7 @@ static void aspeed_gpio_write(void *opaque, hwaddr
> offset, uint64_t data,
> static int get_set_idx(AspeedGPIOState *s, const char *group, int *group_idx)
> {
> AspeedGPIOClass *agc = ASPEED_GPIO_GET_CLASS(s);
> - int set_idx, g_idx = *group_idx;
> + int set_idx, g_idx;
>
> for (set_idx = 0; set_idx < agc->nr_gpio_sets; set_idx++) {
> const GPIOSetProperties *set_props = &agc->props[set_idx];
>
- [PATCH-for-5.0 v2 02/11] blockdev: Remove dead assignment, (continued)
- [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
- [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
- Re: [PATCH-for-5.0 v2 07/11] hw/gpio/aspeed_gpio: Remove dead assignment,
Cédric Le Goater <=
- [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
- [PATCH-for-5.0 v2 11/11] hw/scsi/esp-pci: Remove dead assignment, Philippe Mathieu-Daudé, 2020/03/21
- Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes, Philippe Mathieu-Daudé, 2020/03/21
- Re: [PATCH-for-5.0 v2 00/11] misc: Trivial static code analyzer fixes, Laurent Vivier, 2020/03/23