[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 17/22] util/vhost-user-server: Clean up local variable sha
From: |
Michael S. Tsirkin |
Subject: |
Re: [PATCH v2 17/22] util/vhost-user-server: Clean up local variable shadowing |
Date: |
Fri, 22 Sep 2023 06:23:17 -0400 |
On Mon, Sep 04, 2023 at 06:12:29PM +0200, Philippe Mathieu-Daudé wrote:
> Fix:
>
> util/vhost-user-server.c: In function ‘set_watch’:
> util/vhost-user-server.c:274:20: warning: declaration of ‘vu_fd_watch’
> shadows a previous local [-Wshadow=compatible-local]
> 274 | VuFdWatch *vu_fd_watch = g_new0(VuFdWatch, 1);
> | ^~~~~~~~~~~
> util/vhost-user-server.c:271:16: note: shadowed declaration is here
> 271 | VuFdWatch *vu_fd_watch = find_vu_fd_watch(server, fd);
> | ^~~~~~~~~~~
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
feel free to merge.
> ---
> util/vhost-user-server.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
> index cd17fb5326..5073f775ed 100644
> --- a/util/vhost-user-server.c
> +++ b/util/vhost-user-server.c
> @@ -271,7 +271,7 @@ set_watch(VuDev *vu_dev, int fd, int vu_evt,
> VuFdWatch *vu_fd_watch = find_vu_fd_watch(server, fd);
>
> if (!vu_fd_watch) {
> - VuFdWatch *vu_fd_watch = g_new0(VuFdWatch, 1);
> + vu_fd_watch = g_new0(VuFdWatch, 1);
>
> QTAILQ_INSERT_TAIL(&server->vu_fd_watches, vu_fd_watch, next);
>
> --
> 2.41.0
>
>
- Re: [PATCH v2 12/22] hw/m68k: Clean up local variable shadowing, (continued)
- [PATCH v2 13/22] hw/microblaze: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 14/22] hw/nios2: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 15/22] net/eth: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 16/22] crypto/cipher-gnutls.c: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 17/22] util/vhost-user-server: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- Re: [PATCH v2 17/22] util/vhost-user-server: Clean up local variable shadowing,
Michael S. Tsirkin <=
- [PATCH v2 18/22] semihosting/arm-compat: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 19/22] linux-user/strace: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 20/22] sysemu/device_tree: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [RFC PATCH v2 22/22] softmmu/physmem: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04
- [PATCH v2 21/22] softmmu/memory: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/09/04