mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
hw/usb: Silence compiler warnings in USB code when compiling with -Wshadow
Rename variables or remove nested definitions where it makes sense, so that we can finally compile the USB code with "-Wshadow", too. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20231004130822.113343-1-thuth@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
0edc9e45f3
commit
e7121b1541
5 changed files with 14 additions and 14 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue