aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2023-10-09 10:10:20 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2023-10-09 10:10:20 -0400
commit17a319b175a57ee6fde4dabcaa2e11d47c39301e (patch)
tree1f31bf2c18788942603243604147fc3e7855ed47 /hw/usb
parente068c0b9c7e4da0fca4561730c9449eef56074e6 (diff)
parent77c9f177e02dccd8688eba9550a4fb961742a638 (diff)
downloadqemu-17a319b175a57ee6fde4dabcaa2e11d47c39301e.zip
qemu-17a319b175a57ee6fde4dabcaa2e11d47c39301e.tar.gz
qemu-17a319b175a57ee6fde4dabcaa2e11d47c39301e.tar.bz2
Merge tag 'pull-shadow-2023-10-06' of https://repo.or.cz/qemu/armbru into staging
-Wshadow=local patches patches for 2023-10-06 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmUf72kSHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTDU4P/3R9y5D5d3cj4uI+eaM22+Da0MFUL2gq # bFL192gYj1cmnNqxp+d6ur7FbSlP2AuERHb50Off7jJzdNee+tEeRUPekY+HhKfT # 5Aj6r9M2jV3/sNXqzns7x9Yj2B8xaJlclKPUAaVAxIuhVradWqJiPSkc26sKPB7l # eyqjVvr9+GTQYPSh+YVbYDAUYU9rEL6FiWLPkKm7Kt3/xqp5pTVbUSQbgKQczGWL # /JFILJc5pjISzYPyVxDPSNJY9q4k37JtcJmsO94G9O0GEe5vE72I85OQwI3Fl824 # 1fc2bfkGB6cg1QcJAluOgjuMUe8Wqaw6tnnHgipr1mwFOizrQ9wQW2xRI9RRJfYa # bZmVWIw22P691pgTnFIHWKV6/A2xyq+j00VojQhLyMX9CPPCbIm9hKCZXz6lPGDt # xPX2//q866anFCCyQmimMSeJ4E1GgBTnWgLZMYJ+S3DL/VkW2FGZjiQMyOsRplDm # O6+m6GOiF3wW51uqphaRHwF+PxxNE4Dv+61pYEeKdQELSCAmYrN574BDPehVTcfa # luvSLZEl+qvUbkbw4ysrtiCX2YzVI4COxSscjxCXbku3wRbGSkHBeDadb3p17kuQ # 7FZILaFJo1wXHAine4/f6aNeV/GZihMqJ1cok6SDJh2E1PycF9NTdiKMb/6Zvvf+ # KOVyBhY4NXlj # =uE1Y # -----END PGP SIGNATURE----- # gpg: Signature made Fri 06 Oct 2023 07:28:41 EDT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * tag 'pull-shadow-2023-10-06' of https://repo.or.cz/qemu/armbru: (32 commits) linux-user/syscall.c: clean up local variable shadowing in xattr syscalls linux-user/syscall.c: clean up local variable shadowing in TARGET_NR_getcpu linux-user/syscall.c: clean up local variable shadowing in do_ioctl_dm() linux-user/mmap.c: clean up local variable shadowing linux-user/flatload: clean up local variable shadowing hw/usb: Silence compiler warnings in USB code when compiling with -Wshadow target/ppc: Clean up local variable shadowing in kvm_arch_*_registers() trace/control: Clean up global variable shadowing sysemu/tpm: Clean up global variable shadowing softmmu/vl: Clean up global variable shadowing semihosting/arm-compat: Clean up local variable shadowing util/guest-random: Clean up global variable shadowing util/cutils: Clean up global variable shadowing in get_relocated_path() ui/cocoa: Clean up global variable shadowing semihosting: Clean up global variable shadowing qom/object_interfaces: Clean up global variable shadowing qemu-io: Clean up global variable shadowing qemu-img: Clean up global variable shadowing plugins/loader: Clean up global variable shadowing os-posix: Clean up global variable shadowing ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/desc.c2
-rw-r--r--hw/usb/dev-hub.c8
-rw-r--r--hw/usb/dev-storage.c6
-rw-r--r--hw/usb/hcd-xhci.c10
-rw-r--r--hw/usb/host-libusb.c2
5 files changed, 14 insertions, 14 deletions
diff --git a/hw/usb/desc.c b/hw/usb/desc.c
index 7f6cc2f..f2bdc05 100644
--- a/hw/usb/desc.c
+++ b/hw/usb/desc.c
@@ -227,7 +227,7 @@ int usb_desc_endpoint(const USBDescEndpoint *ep, int flags,
}
if (superlen) {
- USBDescriptor *d = (void *)(dest + bLength);
+ d = (void *)(dest + bLength);
d->bLength = 0x06;
d->bDescriptorType = USB_DT_ENDPOINT_COMPANION;
diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index a6b50db..5703e0e 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -402,7 +402,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBPacket *p,
{
unsigned int n = index - 1;
USBHubPort *port;
- USBDevice *dev;
+ USBDevice *pdev;
trace_usb_hub_set_port_feature(s->dev.addr, index,
feature_name(value));
@@ -411,7 +411,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBPacket *p,
goto fail;
}
port = &s->ports[n];
- dev = port->port.dev;
+ pdev = port->port.dev;
switch(value) {
case PORT_SUSPEND:
port->wPortStatus |= PORT_STAT_SUSPEND;
@@ -419,8 +419,8 @@ static void usb_hub_handle_control(USBDevice *dev, USBPacket *p,
case PORT_RESET:
usb_hub_port_set(port, PORT_STAT_RESET);
usb_hub_port_clear(port, PORT_STAT_RESET);
- if (dev && dev->attached) {
- usb_device_reset(dev);
+ if (pdev && pdev->attached) {
+ usb_device_reset(pdev);
usb_hub_port_set(port, PORT_STAT_ENABLE);
}
usb_wakeup(s->intr, 0);
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index e3bcffb..a496c81 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -403,7 +403,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
struct usb_msd_cbw cbw;
uint8_t devep = p->ep->nr;
SCSIDevice *scsi_dev;
- uint32_t len;
+ int len;
if (s->needs_reset) {
p->status = USB_RET_STALL;
@@ -465,7 +465,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
usb_msd_copy_data(s, p);
}
if (le32_to_cpu(s->csw.residue)) {
- int len = p->iov.size - p->actual_length;
+ len = p->iov.size - p->actual_length;
if (len) {
usb_packet_skip(p, len);
if (len > s->data_len) {
@@ -526,7 +526,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
usb_msd_copy_data(s, p);
}
if (le32_to_cpu(s->csw.residue)) {
- int len = p->iov.size - p->actual_length;
+ len = p->iov.size - p->actual_length;
if (len) {
usb_packet_skip(p, len);
if (len > s->data_len) {
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 324177a..4b60114 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -217,10 +217,10 @@ enum {
(((data) >> field##_SHIFT) & field##_MASK)
#define set_field(data, newval, field) do { \
- uint32_t val = *data; \
- val &= ~(field##_MASK << field##_SHIFT); \
- val |= ((newval) & field##_MASK) << field##_SHIFT; \
- *data = val; \
+ uint32_t val_ = *data; \
+ val_ &= ~(field##_MASK << field##_SHIFT); \
+ val_ |= ((newval) & field##_MASK) << field##_SHIFT; \
+ *data = val_; \
} while (0)
typedef enum EPType {
@@ -1894,7 +1894,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
}
if (epctx->retry) {
- XHCITransfer *xfer = epctx->retry;
+ xfer = epctx->retry;
trace_usb_xhci_xfer_retry(xfer);
assert(xfer->running_retry);
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index f500db8..d7060a4 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1010,7 +1010,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
* Speeds are defined in linux/usb/ch9.h, file not included
* due to name conflicts.
*/
- int rc = ioctl(hostfd, USBDEVFS_GET_SPEED, NULL);
+ rc = ioctl(hostfd, USBDEVFS_GET_SPEED, NULL);
switch (rc) {
case 1: /* low */
libusb_speed = LIBUSB_SPEED_LOW;