[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/8] spapr: Clean up local variable shadowing in spapr_get_fw_dev
From: |
Cédric Le Goater |
Subject: |
[PATCH 5/8] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path() |
Date: |
Mon, 18 Sep 2023 16:58:47 +0200 |
Rename PCIDevice variable to avoid this warning :
../hw/ppc/spapr.c: In function ‘spapr_get_fw_dev_path’:
../hw/ppc/spapr.c:3217:20: warning: declaration of ‘pcidev’ shadows a
previous local [-Wshadow=compatible-local]
3217 | PCIDevice *pcidev = CAST(PCIDevice, dev, TYPE_PCI_DEVICE);
| ^~~~~~
../hw/ppc/spapr.c:3147:16: note: shadowed declaration is here
3147 | PCIDevice *pcidev = CAST(PCIDevice, dev, TYPE_PCI_DEVICE);
| ^~~~~~
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/spapr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 41ce7de77c14..8090fb0302df 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3214,8 +3214,8 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p,
BusState *bus,
if (g_str_equal("pci-bridge", qdev_fw_name(dev))) {
/* SLOF uses "pci" instead of "pci-bridge" for PCI bridges */
- PCIDevice *pcidev = CAST(PCIDevice, dev, TYPE_PCI_DEVICE);
- return g_strdup_printf("pci@%x", PCI_SLOT(pcidev->devfn));
+ PCIDevice *pdev = CAST(PCIDevice, dev, TYPE_PCI_DEVICE);
+ return g_strdup_printf("pci@%x", PCI_SLOT(pdev->devfn));
}
if (pcidev) {
--
2.41.0
- Re: [PATCH 2/8] pnv/psi: Clean up local variable shadowing, (continued)
- [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Cédric Le Goater, 2023/09/18
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Philippe Mathieu-Daudé, 2023/09/18
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Harsh Prateek Bora, 2023/09/19
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Cédric Le Goater, 2023/09/19
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Harsh Prateek Bora, 2023/09/19
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Markus Armbruster, 2023/09/29
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Cédric Le Goater, 2023/09/29
- Re: [PATCH 8/8] spapr/drc: Clean up local variable shadowing in prop_get_fdt(), Harsh Prateek Bora, 2023/09/29
- [PATCH 5/8] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path(),
Cédric Le Goater <=
- [PATCH 7/8] spapr/pci: Clean up local variable shadowing in spapr_phb_realize(), Cédric Le Goater, 2023/09/18
- [PATCH 6/8] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector(), Cédric Le Goater, 2023/09/18