Skip to content

Commit 5ab8ba9

Browse files
LaneWolfhuth
authored andcommitted
host-libusb: Remove unused variable
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 <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Message-Id: <00df0db69ff9167d38bac81f6d03281955bd861a.1668009030.git.mrezanin@redhat.com> Signed-off-by: Thomas Huth <[email protected]>
1 parent 0f48c47 commit 5ab8ba9

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

hw/usb/host-libusb.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,6 @@ static void usb_host_auto_check(void *unused)
18371837
struct USBAutoFilter *f;
18381838
libusb_device **devs = NULL;
18391839
struct libusb_device_descriptor ddesc;
1840-
int unconnected = 0;
18411840
int i, n;
18421841

18431842
if (usb_host_init() != 0) {
@@ -1897,9 +1896,6 @@ static void usb_host_auto_check(void *unused)
18971896
libusb_free_device_list(devs, 1);
18981897

18991898
QTAILQ_FOREACH(s, &hostdevs, next) {
1900-
if (s->dh == NULL) {
1901-
unconnected++;
1902-
}
19031899
if (s->seen == 0) {
19041900
if (s->dh) {
19051901
usb_host_close(s);
@@ -1908,17 +1904,6 @@ static void usb_host_auto_check(void *unused)
19081904
}
19091905
s->seen = 0;
19101906
}
1911-
1912-
#if 0
1913-
if (unconnected == 0) {
1914-
/* nothing to watch */
1915-
if (usb_auto_timer) {
1916-
timer_del(usb_auto_timer);
1917-
trace_usb_host_auto_scan_disabled();
1918-
}
1919-
return;
1920-
}
1921-
#endif
19221907
}
19231908

19241909
if (!usb_vmstate) {

0 commit comments

Comments
 (0)