[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/56] aspeed/i2c: Clean up local variable shadowing
From: |
Markus Armbruster |
Subject: |
[PULL 43/56] aspeed/i2c: Clean up local variable shadowing |
Date: |
Fri, 29 Sep 2023 10:50:40 +0200 |
From: Cédric Le Goater <clg@kaod.org>
Remove superfluous local 'data' variable and use the one define at the
top of the routine. This fixes :
../hw/i2c/aspeed_i2c.c: In function ‘aspeed_i2c_bus_recv’:
../hw/i2c/aspeed_i2c.c:315:17: warning: declaration of ‘data’ shadows a
previous local [-Wshadow=compatible-local]
315 | uint8_t data;
| ^~~~
../hw/i2c/aspeed_i2c.c:288:13: note: shadowed declaration is here
288 | uint8_t data;
| ^~~~
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-ID: <20230922155924.1172019-2-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/i2c/aspeed_i2c.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 7275d40749..1037c22b2f 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -312,7 +312,6 @@ static void aspeed_i2c_bus_recv(AspeedI2CBus *bus)
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_pool_ctrl, RX_COUNT, i & 0xff);
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, RX_BUFF_EN, 0);
} else if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_DMA_EN)) {
- uint8_t data;
/* In new mode, clear how many bytes we RXed */
if (aspeed_i2c_is_new_mode(bus->controller)) {
ARRAY_FIELD_DP32(bus->regs, I2CM_DMA_LEN_STS, RX_LEN, 0);
--
2.41.0
- [PULL 29/56] hw/ppc: Clean up local variable shadowing in _FDT helper routine, (continued)
- [PULL 29/56] hw/ppc: Clean up local variable shadowing in _FDT helper routine, Markus Armbruster, 2023/09/29
- [PULL 16/56] hw/arm/allwinner: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 20/56] net/eth: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 10/56] target/arm/hvf: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 39/56] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd(), Markus Armbruster, 2023/09/29
- [PULL 33/56] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path(), Markus Armbruster, 2023/09/29
- [PULL 36/56] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Markus Armbruster, 2023/09/29
- [PULL 24/56] sysemu/device_tree: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 27/56] hw/core/machine: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 44/56] aspeed: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 43/56] aspeed/i2c: Clean up local variable shadowing,
Markus Armbruster <=
- [PULL 35/56] spapr/pci: Clean up local variable shadowing in spapr_phb_realize(), Markus Armbruster, 2023/09/29
- [PULL 37/56] test-throttle: don't shadow 'index' variable in do_test_accounting(), Markus Armbruster, 2023/09/29
- [PULL 46/56] aspeed/timer: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 56/56] disas/m68k: clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 55/56] hw/nvme: Clean up local variable shadowing in nvme_ns_init(), Markus Armbruster, 2023/09/29
- [PULL 50/56] qemu-nbd: changes towards enabling -Wshadow=local, Markus Armbruster, 2023/09/29
- [PULL 54/56] softmmu/device_tree: Fixup local variables shadowing, Markus Armbruster, 2023/09/29
- [PULL 51/56] hw/riscv: opentitan: Fixup local variables shadowing, Markus Armbruster, 2023/09/29
- [PULL 40/56] hw/misc/arm_sysctl.c: Avoid shadowing local variable, Markus Armbruster, 2023/09/29
- [PULL 42/56] hw/arm/smmuv3-internal.h: Don't use locals in statement macros, Markus Armbruster, 2023/09/29