[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_pr
From: |
Eric Auger |
Subject: |
Re: [PATCH 1/4] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd() |
Date: |
Tue, 26 Sep 2023 17:06:53 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 9/22/23 17:29, Peter Maydell wrote:
> 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>
> ---
> hw/intc/arm_gicv3_its.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c
> index 5f552b4d37f..52e9aca9c65 100644
> --- a/hw/intc/arm_gicv3_its.c
> +++ b/hw/intc/arm_gicv3_its.c
> @@ -545,10 +545,10 @@ static ItsCmdResult do_process_its_cmd(GICv3ITSState
> *s, uint32_t devid,
> }
>
> if (cmdres == CMD_CONTINUE_OK && cmd == DISCARD) {
> - ITEntry ite = {};
> + ITEntry i = {};
> /* remove mapping from interrupt translation table */
> - ite.valid = false;
> - return update_ite(s, eventid, &dte, &ite) ? CMD_CONTINUE_OK :
> CMD_STALL;
> + i.valid = false;
> + return update_ite(s, eventid, &dte, &i) ? CMD_CONTINUE_OK :
> CMD_STALL;
> }
> return CMD_CONTINUE_OK;
> }
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
- [PATCH 0/4] arm: fix some -Wshadow warnings, Peter Maydell, 2023/09/22
- [PATCH 1/4] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd(), Peter Maydell, 2023/09/22
- [PATCH 2/4] hw/misc/arm_sysctl.c: Avoid shadowing local variable, Peter Maydell, 2023/09/22
- [PATCH 3/4] hw/arm/smmuv3.c: Avoid shadowing variable, Peter Maydell, 2023/09/22
- [PATCH 4/4] hw/arm/smmuv3-internal.h: Don't use locals in statement macros, Peter Maydell, 2023/09/22
- Re: [PATCH 0/4] arm: fix some -Wshadow warnings, Markus Armbruster, 2023/09/29