- Sep 29, 2023
-
-
Alistair Francis authored
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags='-Wshadow=local -Wno-error=shadow=local -Wno-error=shadow=compatible-local' To configure Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230925043023.71448-5-alistair.francis@wdc.com> Reviewed-by:
Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Alistair Francis authored
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags='-Wshadow=local -Wno-error=shadow=local -Wno-error=shadow=compatible-local' To configure Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230925043023.71448-4-alistair.francis@wdc.com> Reviewed-by:
Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Alistair Francis authored
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags='-Wshadow=local -Wno-error=shadow=local -Wno-error=shadow=compatible-local' To configure Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230925043023.71448-3-alistair.francis@wdc.com> Reviewed-by:
Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Alistair Francis authored
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Bugs love to hide in such code. Evidence: "[PATCH v3 1/7] migration/rdma: Fix save_page method to fail on polling error". This patch removes the local variable shadowing. Tested by adding: --extra-cflags='-Wshadow=local -Wno-error=shadow=local -Wno-error=shadow=compatible-local' To configure Signed-off-by:
Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230925043023.71448-2-alistair.francis@wdc.com> Reviewed-by:
Daniel Henrique Barboza <dbarboza@ventanamicro.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Eric Blake authored
Address all compiler complaints from -Wshadow in qemu-nbd. Several instances of 'int ret' became shadows when commit 4fbec260 added 'ret' at a higher scope in main. More interesting was the 'void *ret' capturing the result of a pthread; where we were conceptually doing '(void*)(intptr_t)EXIT_FAILURE != NULL' which just feels wrong (even though it happens to compile correctly), so it was worth a better cleanup. Signed-off-by:
Eric Blake <eblake@redhat.com> Message-ID: <20230922205019.2755352-2-eblake@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Daniel P. Berrangé authored
This is confusing as one 'action' variable is used for storing a SCMP_ enum value, while the other 'action' variable is used for storing a SECCOMP_ enum value. Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20230922160644.438631-3-berrange@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Daniel P. Berrangé authored
Both instances of 'ret' are used to store a gnutls API return code. Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20230922160644.438631-2-berrange@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Peter Xu authored
This patch fixes the warning of shadowed local variable: ../hw/i386/intel_iommu.c: In function ‘vtd_address_space_unmap’: ../hw/i386/intel_iommu.c:3773:18: warning: declaration of ‘size’ shadows a previous local [-Wshadow=compatible-local] 3773 | uint64_t size = mask + 1; | ^~~~ ../hw/i386/intel_iommu.c:3747:12: note: shadowed declaration is here 3747 | hwaddr size, remain; | ^~~~ Cc: Jason Wang <jasowang@redhat.com> Cc: Eric Auger <eric.auger@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by:
Peter Xu <peterx@redhat.com> Message-ID: <20230922160410.138786-1-peterx@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
commit 8137355e ("aspeed/timer: Fix behaviour running Linux") introduced a MAX() expression to calculate the next timer deadline : return calculate_time(t, MAX(MAX(t->match[0], t->match[1]), 0)); The second MAX() is not necessary since the compared values are an unsigned and 0. Simply remove it and fix warning : ../hw/timer/aspeed_timer.c: In function ‘calculate_next’: ../include/qemu/osdep.h:396:31: warning: declaration of ‘_a’ shadows a previous local [-Wshadow=compatible-local] 396 | typeof(1 ? (a) : (b)) _a = (a), _b = (b); \ | ^~ ../hw/timer/aspeed_timer.c:170:12: note: in expansion of macro ‘MAX’ 170 | next = MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)), 0); | ^~~ ../hw/timer/aspeed_timer.c:170:16: note: in expansion of macro ‘MAX’ 170 | next = MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)), 0); | ^~~ /home/legoater/work/qemu/qemu-aspeed.git/include/qemu/osdep.h:396:31: note: shadowed declaration is here 396 | typeof(1 ? (a) : (b)) _a = (a), _b = (b); \ | ^~ ../hw/timer/aspeed_timer.c:170:12: note: in expansion of macro ‘MAX’ 170 | next = MAX(MAX(calculate_match(t, 0), calculate_match(t, 1)), 0); | ^~~ Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@aj.id.au> Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230922155924.1172019-5-clg@kaod.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
to fix warning : ../hw/i3c/aspeed_i3c.c: In function ‘aspeed_i3c_realize’: ../hw/i3c/aspeed_i3c.c:1959:17: warning: declaration of ‘dev’ shadows a parameter [-Wshadow=local] 1959 | Object *dev = OBJECT(&s->devices[i]); | ^~~ ../hw/i3c/aspeed_i3c.c:1942:45: note: shadowed declaration is here 1942 | static void aspeed_i3c_realize(DeviceState *dev, Error **errp) | ~~~~~~~~~~~~~^~~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230922155924.1172019-4-clg@kaod.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Andrew Jeffery <andrew@aj.id.au> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
Remove superfluous local 'irq' variables and use the one define at the top of the routine. This fixes warnings in aspeed_soc_ast2600_realize() such as : ../hw/arm/aspeed_ast2600.c: In function ‘aspeed_soc_ast2600_realize’: ../hw/arm/aspeed_ast2600.c:420:18: warning: declaration of ‘irq’ shadows a previous local [-Wshadow=compatible-local] 420 | qemu_irq irq = aspeed_soc_get_irq(s, ASPEED_DEV_TIMER1 + i); | ^~~ ../hw/arm/aspeed_ast2600.c:312:14: note: shadowed declaration is here 312 | qemu_irq irq; | ^~~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230922155924.1172019-3-clg@kaod.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
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>
-
Peter Maydell authored
The STE_CTXPTR() and STE_S2TTB() macros both extract two halves of an address from fields in the STE and combine them into a single value to return. The current code for this uses a GCC statement expression. There are two problems with this: (1) The type chosen for the variable in the statement expr is 'unsigned long', which might not be 64 bits (2) the name chosen for the variable causes -Wshadow warnings because it's the same as a variable in use at the callsite: In file included from ../../hw/arm/smmuv3.c:34: ../../hw/arm/smmuv3.c: In function ‘smmu_get_cd’: ../../hw/arm/smmuv3-internal.h:538:23: warning: declaration of ‘addr’ shadows a previous local [-Wshadow=compatible-local] 538 | unsigned long addr; \ | ^~~~ ../../hw/arm/smmuv3.c:339:23: note: in expansion of macro ‘STE_CTXPTR’ 339 | dma_addr_t addr = STE_CTXPTR(ste); | ^~~~~~~~~~ ../../hw/arm/smmuv3.c:339:16: note: shadowed declaration is here 339 | dma_addr_t addr = STE_CTXPTR(ste); | ^~~~ Sidestep both of these problems by just using a single expression rather than a statement expr. For CMD_ADDR, we got the type of the variable right but still run into -Wshadow problems: In file included from ../../hw/arm/smmuv3.c:34: ../../hw/arm/smmuv3.c: In function ‘smmuv3_range_inval’: ../../hw/arm/smmuv3-internal.h:334:22: warning: declaration of ‘addr’ shadows a previous local [-Wshadow=compatible-local] 334 | uint64_t addr = high << 32 | (low << 12); \ | ^~~~ ../../hw/arm/smmuv3.c:1104:28: note: in expansion of macro ‘CMD_ADDR’ 1104 | dma_addr_t end, addr = CMD_ADDR(cmd); | ^~~~~~~~ ../../hw/arm/smmuv3.c:1104:21: note: shadowed declaration is here 1104 | dma_addr_t end, addr = CMD_ADDR(cmd); | ^~~~ so convert it too. CD_TTB has neither problem, but it is the only other macro in the file that uses this pattern, so we convert it also for consistency's sake. We use extract64() rather than extract32() to avoid having to explicitly cast the result to uint64_t. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230922152944.3583438-5-peter.maydell@linaro.org> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Peter Maydell authored
Avoid shadowing a variable in smmuv3_notify_iova(): ../../hw/arm/smmuv3.c: In function ‘smmuv3_notify_iova’: ../../hw/arm/smmuv3.c:1043:23: warning: declaration of ‘event’ shadows a previous local [-Wshadow=local] 1043 | SMMUEventInfo event = {.inval_ste_allowed = true}; | ^~~~~ ../../hw/arm/smmuv3.c:1038:19: note: shadowed declaration is here 1038 | IOMMUTLBEvent event; | ^~~~~ Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230922152944.3583438-4-peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Peter Maydell authored
Avoid shadowing a local variable in arm_sysctl_write(): ../../hw/misc/arm_sysctl.c: In function ‘arm_sysctl_write’: ../../hw/misc/arm_sysctl.c:537:26: warning: declaration of ‘val’ shadows a parameter [-Wshadow=local] 537 | uint32_t val; | ^~~ ../../hw/misc/arm_sysctl.c:388:39: note: shadowed declaration is here 388 | uint64_t val, unsigned size) | ~~~~~~~~~^~~ Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230922152944.3583438-3-peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Peter Maydell authored
Avoid shadowing a local variable in do_process_its_cmd(): ../../hw/intc/arm_gicv3_its.c:548:17: warning: declaration of ‘ite’ shadows a previous local [-Wshadow=compatible-local] 548 | ITEntry ite = {}; | ^~~ ../../hw/intc/arm_gicv3_its.c:518:13: note: shadowed declaration is here 518 | ITEntry ite; | ^~~ Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230922152944.3583438-2-peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Ani Sinha authored
Code changes in acpi that addresses all compiler complaints coming from enabling -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing other local variables or parameters. These makes the code confusing and/or adds bugs that are difficult to catch. See also Subject: Help wanted for enabling -Wshadow=local Message-Id: <87r0mqlf9x.fsf@pond.sub.org> https://lore.kernel.org/qemu-devel/87r0mqlf9x.fsf@pond.sub.org The code is tested to build with and without the flag turned on. CC: Markus Armbruster <armbru@redhat.com> CC: Philippe Mathieu-Daude <philmd@linaro.org> CC: mst@redhat.com CC: imammedo@redhat.com Signed-off-by:
Ani Sinha <anisinha@redhat.com> Message-ID: <20230922124203.127110-1-anisinha@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> [Commit message tweaked] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Alberto Garcia authored
Fixes build with -Wshadow=local Signed-off-by:
Alberto Garcia <berto@igalia.com> Message-ID: <20230922105742.81317-1-berto@igalia.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
Rename 'name' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘prop_get_fdt’: ../hw/ppc/spapr_drc.c:344:21: warning: declaration of ‘name’ shadows a parameter [-Wshadow=compatible-local] 344 | const char *name = NULL; | ^~~~ ../hw/ppc/spapr_drc.c:325:63: note: shadowed declaration is here 325 | static void prop_get_fdt(Object *obj, Visitor *v, const char *name, | ~~~~~~~~~~~~^~~~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-9-clg@kaod.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
Rename SysBusDevice variable to avoid this warning : ../hw/ppc/spapr_pci.c: In function ‘spapr_phb_realize’: ../hw/ppc/spapr_pci.c:1872:24: warning: declaration of ‘s’ shadows a previous local [-Wshadow=local] 1872 | SpaprPhbState *s; | ^ ../hw/ppc/spapr_pci.c:1829:19: note: shadowed declaration is here 1829 | SysBusDevice *s = SYS_BUS_DEVICE(dev); | ^ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-8-clg@kaod.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
Remove extra 'drc_index' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘rtas_ibm_configure_connector’: ../hw/ppc/spapr_drc.c:1240:26: warning: declaration of ‘drc_index’ shadows a previous local [-Wshadow=compatible-local] 1240 | uint32_t drc_index = spapr_drc_index(drc); | ^~~~~~~~~ ../hw/ppc/spapr_drc.c:1155:14: note: shadowed declaration is here 1155 | uint32_t drc_index; | ^~~~~~~~~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-7-clg@kaod.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
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> Message-ID: <20230918145850.241074-6-clg@kaod.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
Remove extra 'i' variable to fix this warning : ../hw/ppc/spapr.c: In function ‘spapr_init_cpus’: ../hw/ppc/spapr.c:2668:13: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 2668 | int i; | ^ ../hw/ppc/spapr.c:2645:9: note: shadowed declaration is here 2645 | int i; | ^ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-5-clg@kaod.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
Introduce a helper routine defining one CPU device node to fix this warning : ../hw/ppc/spapr.c: In function ‘spapr_dt_cpus’: ../hw/ppc/spapr.c:812:19: warning: declaration of ‘cs’ shadows a previous local [-Wshadow=compatible-local] 812 | CPUState *cs = rev[i]; | ^~ ../hw/ppc/spapr.c:786:15: note: shadowed declaration is here 786 | CPUState *cs; | ^~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-4-clg@kaod.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
to fix : ../hw/ppc/pnv_psi.c: In function ‘pnv_psi_p9_mmio_write’: ../hw/ppc/pnv_psi.c:741:24: warning: declaration of ‘addr’ shadows a parameter [-Wshadow=compatible-local] 741 | hwaddr addr = val & ~(PSIHB9_ESB_CI_VALID | PSIHB10_ESB_CI_64K); | ^~~~ ../hw/ppc/pnv_psi.c:702:56: note: shadowed declaration is here 702 | static void pnv_psi_p9_mmio_write(void *opaque, hwaddr addr, | ~~~~~~~^~~~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-3-clg@kaod.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Cédric Le Goater authored
this fixes numerous warnings of this type : In file included from ../hw/ppc/spapr_pci.c:43: ../hw/ppc/spapr_pci.c: In function ‘spapr_dt_phb’: ../include/hw/ppc/fdt.h:18:13: warning: declaration of ‘ret’ shadows a previous local [-Wshadow=compatible-local] 18 | int ret = (exp); \ | ^~~ ../hw/ppc/spapr_pci.c:2355:5: note: in expansion of macro ‘_FDT’ 2355 | _FDT(bus_off = fdt_add_subnode(fdt, 0, phb->dtbusname)); | ^~~~ ../hw/ppc/spapr_pci.c:2311:24: note: shadowed declaration is here 2311 | int bus_off, i, j, ret; | ^~~ Signed-off-by:
Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-2-clg@kaod.org> Reviewed-by:
Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/intc/openpic.c: In function ‘openpic_gbl_write’: hw/intc/openpic.c:614:17: warning: declaration of ‘idx’ shadows a previous local [-Wshadow=compatible-local] 614 | int idx; | ^~~ hw/intc/openpic.c:568:9: note: shadowed declaration is here 568 | int idx; | ^~~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904162824.85385-3-philmd@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/core/machine.c: In function ‘machine_initfn’: hw/core/machine.c:1081:17: warning: declaration of ‘obj’ shadows a parameter [-Wshadow=compatible-local] 1081 | Object *obj = OBJECT(ms); | ^~~ hw/core/machine.c:1065:36: note: shadowed declaration is here 1065 | static void machine_initfn(Object *obj) | ~~~~~~~~^~~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904162824.85385-2-philmd@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: softmmu/physmem.c: In function ‘cpu_physical_memory_snapshot_and_clear_dirty’: softmmu/physmem.c:916:27: warning: declaration of ‘offset’ shadows a parameter [-Wshadow=compatible-local] 916 | unsigned long offset = page % DIRTY_MEMORY_BLOCK_SIZE; | ^~~~~~ softmmu/physmem.c:892:31: note: shadowed declaration is here 892 | (MemoryRegion *mr, hwaddr offset, hwaddr length, unsigned client) | ~~~~~~~^~~~~~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-23-philmd@linaro.org> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: softmmu/memory.c: In function ‘mtree_print_mr’: softmmu/memory.c:3236:27: warning: declaration of ‘ml’ shadows a previous local [-Wshadow=compatible-local] 3236 | MemoryRegionList *ml; | ^~ softmmu/memory.c:3213:32: note: shadowed declaration is here 3213 | MemoryRegionList *new_ml, *ml, *next_ml; | ^~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-22-philmd@linaro.org> Reviewed-by:
Peter Xu <peterx@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/mips/boston.c:472:5: error: declaration shadows a local variable [-Werror,-Wshadow] qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size); ^ include/sysemu/device_tree.h:129:13: note: expanded from macro 'qemu_fdt_setprop_cells' int i; ^ hw/mips/boston.c:461:9: note: previous declaration is here int i; ^ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-21-philmd@linaro.org> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: linux-user/strace.c: In function ‘print_sockaddr’: linux-user/strace.c:370:17: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 370 | int i; | ^ linux-user/strace.c:361:9: note: shadowed declaration is here 361 | int i; | ^ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-20-philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: util/vhost-user-server.c: In function ‘set_watch’: util/vhost-user-server.c:274:20: warning: declaration of ‘vu_fd_watch’ shadows a previous local [-Wshadow=compatible-local] 274 | VuFdWatch *vu_fd_watch = g_new0(VuFdWatch, 1); | ^~~~~~~~~~~ util/vhost-user-server.c:271:16: note: shadowed declaration is here 271 | VuFdWatch *vu_fd_watch = find_vu_fd_watch(server, fd); | ^~~~~~~~~~~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-18-philmd@linaro.org> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: In file included from crypto/cipher.c:140: crypto/cipher-gnutls.c.inc: In function ‘qcrypto_gnutls_cipher_encrypt’: crypto/cipher-gnutls.c.inc:116:17: warning: declaration of ‘err’ shadows a previous local [-Wshadow=compatible-local] 116 | int err = gnutls_cipher_init(&handle, ctx->galg, &gkey, NULL); | ^~~ crypto/cipher-gnutls.c.inc:94:9: note: shadowed declaration is here 94 | int err; | ^~~ --- crypto/cipher-gnutls.c.inc: In function ‘qcrypto_gnutls_cipher_decrypt’: crypto/cipher-gnutls.c.inc:177:17: warning: declaration of ‘err’ shadows a previous local [-Wshadow=compatible-local] 177 | int err = gnutls_cipher_init(&handle, ctx->galg, &gkey, NULL); | ^~~ crypto/cipher-gnutls.c.inc:154:9: note: shadowed declaration is here 154 | int err; | ^~~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-17-philmd@linaro.org> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: net/eth.c:435:20: error: declaration shadows a local variable [-Werror,-Wshadow] size_t input_size = iov_size(pkt, pkt_frags); ^ net/eth.c:413:16: note: previous declaration is here size_t input_size = iov_size(pkt, pkt_frags); ^ Suggested-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-16-philmd@linaro.org> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/nios2/10m50_devboard.c: In function ‘nios2_10m50_ghrd_init’: hw/nios2/10m50_devboard.c:101:22: warning: declaration of ‘dev’ shadows a previous local [-Wshadow=compatible-local] 101 | DeviceState *dev = qdev_new(TYPE_NIOS2_VIC); | ^~~ hw/nios2/10m50_devboard.c:60:18: note: shadowed declaration is here 60 | DeviceState *dev; | ^~~ hw/nios2/10m50_devboard.c:110:18: warning: declaration of ‘i’ shadows a previous local [-Wshadow=compatible-local] 110 | for (int i = 0; i < 32; i++) { | ^ hw/nios2/10m50_devboard.c:67:9: note: shadowed declaration is here 67 | int i; | ^ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-15-philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/microblaze/petalogix_ml605_mmu.c: In function ‘petalogix_ml605_init’: hw/microblaze/petalogix_ml605_mmu.c:186:24: warning: declaration of ‘dinfo’ shadows a previous local [-Wshadow=compatible-local] 186 | DriveInfo *dinfo = drive_get(IF_MTD, 0, i); | ^~~~~ hw/microblaze/petalogix_ml605_mmu.c:78:16: note: shadowed declaration is here 78 | DriveInfo *dinfo; | ^~~~~ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-14-philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/m68k/virt.c:263:13: error: declaration shadows a local variable [-Werror,-Wshadow] BOOTINFOSTR(param_ptr, BI_COMMAND_LINE, ^ hw/m68k/bootinfo.h:47:13: note: expanded from macro 'BOOTINFOSTR' int i; \ ^ hw/m68k/virt.c:130:9: note: previous declaration is here int i; ^ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20230904161235.84651-13-philmd@linaro.org> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
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> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230904161235.84651-10-philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Philippe Mathieu-Daudé authored
Fix: hw/arm/virt.c:821:22: error: declaration shadows a local variable [-Werror,-Wshadow] qemu_irq irq = qdev_get_gpio_in(vms->gic, ^ hw/arm/virt.c:803:13: note: previous declaration is here int irq; ^ Signed-off-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-ID: <20230904161235.84651-9-philmd@linaro.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-