qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
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	[thread overview]
Message-ID: <ac328c75-3972-ec50-5771-71c5fd24b2aa@redhat.com> (raw)
In-Reply-To: <20230922152944.3583438-2-peter.maydell@linaro.org>



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



  parent reply	other threads:[~2023-09-26 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 15:29 [PATCH 0/4] arm: fix some -Wshadow warnings Peter Maydell
2023-09-22 15:29 ` [PATCH 1/4] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd() Peter Maydell
2023-09-22 15:38   ` Philippe Mathieu-Daudé
2023-09-26 15:06   ` Eric Auger [this message]
2023-09-22 15:29 ` [PATCH 2/4] hw/misc/arm_sysctl.c: Avoid shadowing local variable Peter Maydell
2023-09-22 15:38   ` Philippe Mathieu-Daudé
2023-09-26 15:06   ` Eric Auger
2023-09-22 15:29 ` [PATCH 3/4] hw/arm/smmuv3.c: Avoid shadowing variable Peter Maydell
2023-09-22 15:38   ` Philippe Mathieu-Daudé
2023-09-26 15:00   ` Eric Auger
2023-09-22 15:29 ` [PATCH 4/4] hw/arm/smmuv3-internal.h: Don't use locals in statement macros Peter Maydell
2023-09-26 15:00   ` Eric Auger
2023-09-29  6:16 ` [PATCH 0/4] arm: fix some -Wshadow warnings Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac328c75-3972-ec50-5771-71c5fd24b2aa@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).