From: Yosry Ahmed <yosry@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Andrew Jones <andrew.jones@linux.dev>
Cc: Greg Thelen <gthelen@google.com>,
kvm@vger.kernel.org, Yosry Ahmed <yosry@kernel.org>
Subject: [kvm-unit-tests PATCH 1/2] chr-testdev: Remove unused in_vq
Date: Thu, 22 Oct 2026 20:44:12 +0000 [thread overview]
Message-ID: <20261022204413.856786-2-yosry@kernel.org> (raw)
In-Reply-To: <20261022204413.856786-1-yosry@kernel.org>
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
next prev parent reply other threads:[~2026-10-22 20:44 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 ` Yosry Ahmed [this message]
2026-10-23 9:58 ` [kvm-unit-tests PATCH 1/2] chr-testdev: Remove unused in_vq Andrew Jones
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=20261022204413.856786-2-yosry@kernel.org \
--to=yosry@kernel.org \
--cc=andrew.jones@linux.dev \
--cc=gthelen@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--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