[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/11] hw/arm/allwinner: Clean up local variable shadowing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 06/11] hw/arm/allwinner: Clean up local variable shadowing |
Date: |
Fri, 1 Sep 2023 00:56:01 +0200 |
Fix:
hw/arm/allwinner-r40.c:412:14: error: declaration shadows a local variable
[-Werror,-Wshadow]
for (int i = 0; i < AW_R40_NUM_MMCS; i++) {
^
hw/arm/allwinner-r40.c:299:14: note: previous declaration is here
unsigned i;
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/allwinner-r40.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c
index 7d29eb224f..a0d367c60d 100644
--- a/hw/arm/allwinner-r40.c
+++ b/hw/arm/allwinner-r40.c
@@ -296,10 +296,9 @@ static void allwinner_r40_realize(DeviceState *dev, Error
**errp)
{
const char *r40_nic_models[] = { "gmac", "emac", NULL };
AwR40State *s = AW_R40(dev);
- unsigned i;
/* CPUs */
- for (i = 0; i < AW_R40_NUM_CPUS; i++) {
+ for (unsigned i = 0; i < AW_R40_NUM_CPUS; i++) {
/*
* Disable secondary CPUs. Guest EL3 firmware will start
@@ -335,7 +334,7 @@ static void allwinner_r40_realize(DeviceState *dev, Error
**errp)
* maintenance interrupt signal to the appropriate GIC PPI inputs,
* and the GIC's IRQ/FIQ/VIRQ/VFIQ interrupt outputs to the CPU's inputs.
*/
- for (i = 0; i < AW_R40_NUM_CPUS; i++) {
+ for (unsigned i = 0; i < AW_R40_NUM_CPUS; i++) {
DeviceState *cpudev = DEVICE(&s->cpus[i]);
int ppibase = AW_R40_GIC_NUM_SPI + i * GIC_INTERNAL + GIC_NR_SGIS;
int irq;
@@ -494,7 +493,7 @@ static void allwinner_r40_realize(DeviceState *dev, Error
**errp)
qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_EMAC));
/* Unimplemented devices */
- for (i = 0; i < ARRAY_SIZE(r40_unimplemented); i++) {
+ for (unsigned i = 0; i < ARRAY_SIZE(r40_unimplemented); i++) {
create_unimplemented_device(r40_unimplemented[i].device_name,
r40_unimplemented[i].base,
r40_unimplemented[i].size);
--
2.41.0
- [PATCH 00/11] (few more) Steps towards enabling -Wshadow, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 01/11] tcg: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 02/11] target/arm: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 03/11] target/mips: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 04/11] target/m68k: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 05/11] hw/arm/virt: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 06/11] hw/arm/allwinner: Clean up local variable shadowing,
Philippe Mathieu-Daudé <=
- [PATCH 07/11] hw/arm/aspeed: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 08/11] hw/m68k: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 09/11] hw/ide/ahci: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 10/11] net/eth: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 11/11] sysemu/device_tree: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31