diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-12-06 13:10:34 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-01-11 15:46:55 +0100 |
commit | eae3eb3e185028d6e862db747e3b7397600d6762 (patch) | |
tree | 359a23639a6db7a77407cf8f366564561b970738 /hw | |
parent | 7274f01bb8b81ffe8f13f463b6b0f3b9246c5387 (diff) |
qemu/queue.h: simplify reverse access to QTAILQ
The new definition of QTAILQ does not require passing the headname,
remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/core/qdev.c | 4 | ||||
-rw-r--r-- | hw/scsi/scsi-bus.c | 2 | ||||
-rw-r--r-- | hw/usb/combined-packet.c | 2 | ||||
-rw-r--r-- | hw/usb/dev-mtp.c | 4 | ||||
-rw-r--r-- | hw/usb/hcd-ehci.c | 2 | ||||
-rw-r--r-- | hw/usb/hcd-ehci.h | 2 | ||||
-rw-r--r-- | hw/usb/hcd-uhci.c | 4 |
7 files changed, 10 insertions, 10 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3769a2bccb..58ad8a64fc 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -158,7 +158,7 @@ DeviceState *qdev_try_create(BusState *bus, const char *type) return dev; } -static QTAILQ_HEAD(device_listeners, DeviceListener) device_listeners +static QTAILQ_HEAD(, DeviceListener) device_listeners = QTAILQ_HEAD_INITIALIZER(device_listeners); enum ListenerDirection { Forward, Reverse }; @@ -177,7 +177,7 @@ enum ListenerDirection { Forward, Reverse }; break; \ case Reverse: \ QTAILQ_FOREACH_REVERSE(_listener, &device_listeners, \ - device_listeners, link) { \ + link) { \ if (_listener->_callback) { \ _listener->_callback(_listener, ##_args); \ } \ diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 97cd167114..c480553083 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1554,7 +1554,7 @@ SCSIDevice *scsi_device_find(SCSIBus *bus, int channel, int id, int lun) BusChild *kid; SCSIDevice *target_dev = NULL; - QTAILQ_FOREACH_REVERSE(kid, &bus->qbus.children, ChildrenHead, sibling) { + QTAILQ_FOREACH_REVERSE(kid, &bus->qbus.children, sibling) { DeviceState *qdev = kid->child; SCSIDevice *dev = SCSI_DEVICE(qdev); diff --git a/hw/usb/combined-packet.c b/hw/usb/combined-packet.c index 01a7ed0848..fc98383d30 100644 --- a/hw/usb/combined-packet.c +++ b/hw/usb/combined-packet.c @@ -64,7 +64,7 @@ void usb_combined_input_packet_complete(USBDevice *dev, USBPacket *p) status = combined->first->status; actual_length = combined->first->actual_length; - short_not_ok = QTAILQ_LAST(&combined->packets, packets_head)->short_not_ok; + short_not_ok = QTAILQ_LAST(&combined->packets)->short_not_ok; QTAILQ_FOREACH_SAFE(p, &combined->packets, combined_entry, next) { if (!done) { diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index b19b576278..68c5eb8eaa 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -191,7 +191,7 @@ struct MTPState { #ifdef CONFIG_INOTIFY1 /* inotify descriptor */ int inotifyfd; - QTAILQ_HEAD(events, MTPMonEntry) events; + QTAILQ_HEAD(, MTPMonEntry) events; #endif /* Responder is expecting a write operation */ bool write_pending; @@ -1989,7 +1989,7 @@ static void usb_mtp_handle_data(USBDevice *dev, USBPacket *p) case EP_EVENT: #ifdef CONFIG_INOTIFY1 if (!QTAILQ_EMPTY(&s->events)) { - struct MTPMonEntry *e = QTAILQ_LAST(&s->events, events); + struct MTPMonEntry *e = QTAILQ_LAST(&s->events); uint32_t handle; int len = sizeof(container) + sizeof(uint32_t); diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 8d44d483df..e233681962 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1823,7 +1823,7 @@ static int ehci_state_fetchqtd(EHCIQueue *q) break; case EHCI_ASYNC_INFLIGHT: /* Check if the guest has added new tds to the queue */ - again = ehci_fill_queue(QTAILQ_LAST(&q->packets, pkts_head)); + again = ehci_fill_queue(QTAILQ_LAST(&q->packets)); /* Unfinished async handled packet, go horizontal */ ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH); break; diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h index cd30b5d5e0..d6601706ee 100644 --- a/hw/usb/hcd-ehci.h +++ b/hw/usb/hcd-ehci.h @@ -247,7 +247,7 @@ struct EHCIQueue { uint32_t qtdaddr; /* address QTD read from */ int last_pid; /* pid of last packet executed */ USBDevice *dev; - QTAILQ_HEAD(pkts_head, EHCIPacket) packets; + QTAILQ_HEAD(, EHCIPacket) packets; }; typedef QTAILQ_HEAD(EHCIQueueHead, EHCIQueue) EHCIQueueHead; diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 836b11f177..26f123ed78 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -99,7 +99,7 @@ struct UHCIQueue { UHCIState *uhci; USBEndpoint *ep; QTAILQ_ENTRY(UHCIQueue) next; - QTAILQ_HEAD(asyncs_head, UHCIAsync) asyncs; + QTAILQ_HEAD(, UHCIAsync) asyncs; int8_t valid; }; @@ -837,7 +837,7 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr, } if (!async->done) { UHCI_TD last_td; - UHCIAsync *last = QTAILQ_LAST(&async->queue->asyncs, asyncs_head); + UHCIAsync *last = QTAILQ_LAST(&async->queue->asyncs); /* * While we are waiting for the current td to complete, the guest * may have added more tds to the queue. Note we re-read the td |