[PATCH 03/10] tests/virtio-scsi: Clean up global variable shadowing

Philippe Mathieu-Daudé posted 10 patches 1 year, 1 month ago
Maintainers: John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Fam Zheng <fam@euphon.net>, Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>
[PATCH 03/10] tests/virtio-scsi: Clean up global variable shadowing
Posted by Philippe Mathieu-Daudé 1 year, 1 month ago
Rename the (unused) 'allow' argument, following the pattern
used by the other tests in this file. This fixes:

  tests/qtest/virtio-scsi-test.c:159:61: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
  static void hotplug(void *obj, void *data, QGuestAllocator *alloc)
                                                              ^
  tests/qtest/virtio-scsi-test.c:37:25: note: previous declaration is here
  static QGuestAllocator *alloc;
                          ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/virtio-scsi-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c
index ceaa7f2415..db10d572d0 100644
--- a/tests/qtest/virtio-scsi-test.c
+++ b/tests/qtest/virtio-scsi-test.c
@@ -156,7 +156,7 @@ static QVirtioSCSIQueues *qvirtio_scsi_init(QVirtioDevice *dev)
     return vs;
 }
 
-static void hotplug(void *obj, void *data, QGuestAllocator *alloc)
+static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
 {
     QTestState *qts = global_qtest;
 
-- 
2.41.0


Re: [PATCH 03/10] tests/virtio-scsi: Clean up global variable shadowing
Posted by Manos Pitsidianakis 1 year, 1 month ago
On Mon, 09 Oct 2023 13:02, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>Rename the (unused) 'allow' argument, following the pattern

s/allow/alloc

Otherwise,

Reviewed-By: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>

>used by the other tests in this file. This fixes:
>
>  tests/qtest/virtio-scsi-test.c:159:61: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
>  static void hotplug(void *obj, void *data, QGuestAllocator *alloc)
>                                                              ^
>  tests/qtest/virtio-scsi-test.c:37:25: note: previous declaration is here
>  static QGuestAllocator *alloc;
>                          ^
>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
> tests/qtest/virtio-scsi-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c
>index ceaa7f2415..db10d572d0 100644
>--- a/tests/qtest/virtio-scsi-test.c
>+++ b/tests/qtest/virtio-scsi-test.c
>@@ -156,7 +156,7 @@ static QVirtioSCSIQueues *qvirtio_scsi_init(QVirtioDevice *dev)
>     return vs;
> }
> 
>-static void hotplug(void *obj, void *data, QGuestAllocator *alloc)
>+static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
> {
>     QTestState *qts = global_qtest;
> 
>-- 
>2.41.0
>
>

Re: [PATCH 03/10] tests/virtio-scsi: Clean up global variable shadowing
Posted by Thomas Huth 1 year, 1 month ago
On 09/10/2023 12.02, Philippe Mathieu-Daudé wrote:
> Rename the (unused) 'allow' argument, following the pattern
> used by the other tests in this file. This fixes:
> 
>    tests/qtest/virtio-scsi-test.c:159:61: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
>    static void hotplug(void *obj, void *data, QGuestAllocator *alloc)
>                                                                ^
>    tests/qtest/virtio-scsi-test.c:37:25: note: previous declaration is here
>    static QGuestAllocator *alloc;
>                            ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/qtest/virtio-scsi-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c
> index ceaa7f2415..db10d572d0 100644
> --- a/tests/qtest/virtio-scsi-test.c
> +++ b/tests/qtest/virtio-scsi-test.c
> @@ -156,7 +156,7 @@ static QVirtioSCSIQueues *qvirtio_scsi_init(QVirtioDevice *dev)
>       return vs;
>   }
>   
> -static void hotplug(void *obj, void *data, QGuestAllocator *alloc)
> +static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
>   {
>       QTestState *qts = global_qtest;
>   

Reviewed-by: Thomas Huth <thuth@redhat.com>