qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] hw/virtio/virtio-pci: Avoid compiler warning with -Wshado


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2] hw/virtio/virtio-pci: Avoid compiler warning with -Wshadow
Date: Wed, 4 Oct 2023 12:05:53 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 4/10/23 11:53, Thomas Huth wrote:
"len" is used as parameter of the functions virtio_write_config()
and virtio_read_config(), and additionally as a local variable,
so this causes a compiler warning when compiling with "-Wshadow"
and can be confusing for the reader. Rename the local variables
to "caplen" to avoid this problem.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
  v2: Fix virtio_read_config() function as well

  hw/virtio/virtio-pci.c | 20 ++++++++++----------
  1 file changed, 10 insertions(+), 10 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]