[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/11] hw/ide/ahci: Clean up local variable shadowing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 09/11] hw/ide/ahci: Clean up local variable shadowing |
Date: |
Fri, 1 Sep 2023 00:56:04 +0200 |
hw/ide/ahci.c:1577:23: error: declaration shadows a local variable
[-Werror,-Wshadow]
IDEState *s = &ad->port.ifs[j];
^
hw/ide/ahci.c:1569:29: note: previous declaration is here
void ahci_uninit(AHCIState *s)
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ide/ahci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 48d550f633..8c9a7c2117 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1573,10 +1573,8 @@ void ahci_uninit(AHCIState *s)
for (i = 0; i < s->ports; i++) {
AHCIDevice *ad = &s->dev[i];
- for (j = 0; j < 2; j++) {
- IDEState *s = &ad->port.ifs[j];
-
- ide_exit(s);
+ for (j = 0; j < ARRAY_SIZE(ad->port.ifs); j++) {
+ ide_exit(&ad->port.ifs[j]);
}
object_unparent(OBJECT(&ad->port));
}
--
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é, 2023/08/31
- [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é <=
- [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