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 3/4] hw/arm/smmuv3.c: Avoid shadowing variable
Date: Tue, 26 Sep 2023 17:00:52 +0200 [thread overview]
Message-ID: <8dc93aed-d107-3514-01cb-19bba64ce7fe@redhat.com> (raw)
In-Reply-To: <20230922152944.3583438-4-peter.maydell@linaro.org>
Hi Peter,
On 9/22/23 17:29, Peter Maydell wrote:
> 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>
> ---
> hw/arm/smmuv3.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 1e9be8e89af..6f2b2bd45f9 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1040,8 +1040,8 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr,
> SMMUv3State *s = sdev->smmu;
>
> if (!tg) {
> - SMMUEventInfo event = {.inval_ste_allowed = true};
> - SMMUTransCfg *cfg = smmuv3_get_config(sdev, &event);
> + SMMUEventInfo eventinfo = {.inval_ste_allowed = true};
> + SMMUTransCfg *cfg = smmuv3_get_config(sdev, &eventinfo);
> SMMUTransTableInfo *tt;
>
> if (!cfg) {
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks!
Eric
next prev parent reply other threads:[~2023-09-26 15:02 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
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 [this message]
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=8dc93aed-d107-3514-01cb-19bba64ce7fe@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).