From: Thomas Huth <thuth@redhat.com>
To: mrezanin@redhat.com, qemu-devel@nongnu.org
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 4/4] host-libusb: Remove unused variable
Date: Thu, 10 Nov 2022 09:44:59 +0100 [thread overview]
Message-ID: <f6c1e498-7f23-5489-56d7-d1b1b598ef19@redhat.com> (raw)
In-Reply-To: <00df0db69ff9167d38bac81f6d03281955bd861a.1668009030.git.mrezanin@redhat.com>
On 09/11/2022 16.57, mrezanin@redhat.com wrote:
> From: Miroslav Rezanina <mrezanin@redhat.com>
>
> Variable unconnected used in usb_host_auto_check function is only incremented
> but never read as line where it is read was disabled since introducing the code.
> This causes 'Unused but set variable' warning on Clang 15.0.1 compiler.
>
> Removing the variable and disabled code to prevent the warning.
>
> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
> ---
> hw/usb/host-libusb.c | 15 ---------------
> 1 file changed, 15 deletions(-)
>
> diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
> index 28f8af8941..176868d345 100644
> --- a/hw/usb/host-libusb.c
> +++ b/hw/usb/host-libusb.c
> @@ -1837,7 +1837,6 @@ static void usb_host_auto_check(void *unused)
> struct USBAutoFilter *f;
> libusb_device **devs = NULL;
> struct libusb_device_descriptor ddesc;
> - int unconnected = 0;
> int i, n;
>
> if (usb_host_init() != 0) {
> @@ -1897,9 +1896,6 @@ static void usb_host_auto_check(void *unused)
> libusb_free_device_list(devs, 1);
>
> QTAILQ_FOREACH(s, &hostdevs, next) {
> - if (s->dh == NULL) {
> - unconnected++;
> - }
> if (s->seen == 0) {
> if (s->dh) {
> usb_host_close(s);
> @@ -1908,17 +1904,6 @@ static void usb_host_auto_check(void *unused)
> }
> s->seen = 0;
> }
> -
> -#if 0
> - if (unconnected == 0) {
> - /* nothing to watch */
> - if (usb_auto_timer) {
> - timer_del(usb_auto_timer);
> - trace_usb_host_auto_scan_disabled();
> - }
> - return;
> - }
> -#endif
> }
>
> if (!usb_vmstate) {
Reviewed-by: Thomas Huth <thuth@redhat.com>
prev parent reply other threads:[~2022-11-10 8:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 15:57 [PATCH 0/4] Removal of several unused variables causing mrezanin
2022-11-09 15:57 ` [PATCH 1/4] rtl8139: Remove unused variable mrezanin
2022-11-10 8:40 ` Thomas Huth
2022-11-09 15:57 ` [PATCH 2/4] tulip: " mrezanin
2022-11-10 8:41 ` Thomas Huth
2022-11-09 15:57 ` [PATCH 3/4] qemu-img: remove " mrezanin
2022-11-10 8:43 ` Thomas Huth
2022-11-09 15:57 ` [PATCH 4/4] host-libusb: Remove " mrezanin
2022-11-10 8:44 ` Thomas Huth [this message]
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=f6c1e498-7f23-5489-56d7-d1b1b598ef19@redhat.com \
--to=thuth@redhat.com \
--cc=kraxel@redhat.com \
--cc=mrezanin@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.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;
as well as URLs for NNTP newsgroup(s).