qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH] libvhost-user: Fix compiler warning with -Wshadow=local
Date: Sun, 8 Oct 2023 02:21:13 -0400	[thread overview]
Message-ID: <20231008022107-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20231006121129.487251-1-thuth@redhat.com>

On Fri, Oct 06, 2023 at 02:11:29PM +0200, Thomas Huth wrote:
> Rename shadowing variables to make this code compilable
> with -Wshadow=local.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  subprojects/libvhost-user/libvhost-user.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
> index 051a611da3..ea2822a44c 100644
> --- a/subprojects/libvhost-user/libvhost-user.c
> +++ b/subprojects/libvhost-user/libvhost-user.c
> @@ -870,10 +870,10 @@ vu_rem_mem_reg(VuDev *dev, VhostUserMsg *vmsg) {
>      for (i = 0; i < dev->nregions; i++) {
>          if (reg_equal(&dev->regions[i], msg_region)) {
>              VuDevRegion *r = &dev->regions[i];
> -            void *m = (void *) (uintptr_t) r->mmap_addr;
> +            void *ma = (void *) (uintptr_t) r->mmap_addr;
>  
> -            if (m) {
> -                munmap(m, r->size + r->mmap_offset);
> +            if (ma) {
> +                munmap(ma, r->size + r->mmap_offset);
>              }
>  
>              /*
> @@ -1005,10 +1005,10 @@ vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg)
>  
>      for (i = 0; i < dev->nregions; i++) {
>          VuDevRegion *r = &dev->regions[i];
> -        void *m = (void *) (uintptr_t) r->mmap_addr;
> +        void *ma = (void *) (uintptr_t) r->mmap_addr;
>  
> -        if (m) {
> -            munmap(m, r->size + r->mmap_offset);
> +        if (ma) {
> +            munmap(ma, r->size + r->mmap_offset);
>          }
>      }
>      dev->nregions = memory->nregions;
> -- 
> 2.41.0



  reply	other threads:[~2023-10-08  6:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 12:11 [PATCH] libvhost-user: Fix compiler warning with -Wshadow=local Thomas Huth
2023-10-08  6:21 ` Michael S. Tsirkin [this message]
2023-10-12  6:08 ` 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=20231008022107-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    /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).