From: Andrew Jones <andrew.jones@linux.dev>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>, Greg Thelen <gthelen@google.com>,
kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH 1/2] chr-testdev: Remove unused in_vq
Date: Fri, 23 Oct 2026 11:58:50 +0200 [thread overview]
Message-ID: <atsv0knRRoBCeQSi@orel> (raw)
In-Reply-To: <20261022204413.856786-2-yosry@kernel.org>
On Thu, Oct 22, 2026 at 08:44:12PM +0000, Yosry Ahmed wrote:
> in_vq is assigned in chr_testdev_init() from vqs[0], but kvm-unit-tests
> only writes to the character device via out_vq and never consumes input
> from the host. Clang 24 warns on this with -Wunused-but-set-global:
>
> lib/chr-testdev.c:15:26: error: variable 'in_vq' set but not used
> [-Werror,-Wunused-but-set-global]
>
> Remove the unused variable.
>
> Fixes: b412ad0d39a1 ("Introduce chr-testdev")
> Co-developed-by: Greg Thelen <gthelen@google.com>
> Signed-off-by: Greg Thelen <gthelen@google.com>
> Signed-off-by: Yosry Ahmed <yosry@kernel.org>
> ---
> lib/chr-testdev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/chr-testdev.c b/lib/chr-testdev.c
> index b3c641a833feb..c23fd92a46308 100644
> --- a/lib/chr-testdev.c
> +++ b/lib/chr-testdev.c
> @@ -12,7 +12,7 @@
> #define TESTDEV_NAME "chr-testdev"
>
> static struct virtio_device *vcon;
> -static struct virtqueue *in_vq, *out_vq;
> +static struct virtqueue *out_vq;
> static struct spinlock lock;
>
> static void __testdev_send(char *buf, unsigned int len)
> @@ -65,6 +65,5 @@ void chr_testdev_init(void)
> return;
> }
>
> - in_vq = vqs[0];
> out_vq = vqs[1];
> }
> --
> 2.56.0.257.gf7497c7d27-goog
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
next prev parent reply other threads:[~2026-10-23 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 20:44 [kvm-unit-tests PATCH 0/2] Fix Clang 24 -Wunused-but-set-global warnings Yosry Ahmed
2026-10-22 20:44 ` [kvm-unit-tests PATCH 1/2] chr-testdev: Remove unused in_vq Yosry Ahmed
2026-10-23 9:58 ` Andrew Jones [this message]
2026-10-22 20:44 ` [kvm-unit-tests PATCH 2/2] x86/desc: Remove unused exception flag Yosry Ahmed
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=atsv0knRRoBCeQSi@orel \
--to=andrew.jones@linux.dev \
--cc=gthelen@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=thuth@redhat.com \
--cc=yosry@kernel.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