aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-12-06 13:10:34 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-01-11 15:46:55 +0100
commiteae3eb3e185028d6e862db747e3b7397600d6762 (patch)
tree359a23639a6db7a77407cf8f366564561b970738 /hw/usb
parent7274f01bb8b81ffe8f13f463b6b0f3b9246c5387 (diff)
downloadqemu-eae3eb3e185028d6e862db747e3b7397600d6762.zip
qemu-eae3eb3e185028d6e862db747e3b7397600d6762.tar.gz
qemu-eae3eb3e185028d6e862db747e3b7397600d6762.tar.bz2
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/usb')
-rw-r--r--hw/usb/combined-packet.c2
-rw-r--r--hw/usb/dev-mtp.c4
-rw-r--r--hw/usb/hcd-ehci.c2
-rw-r--r--hw/usb/hcd-ehci.h2
-rw-r--r--hw/usb/hcd-uhci.c4
5 files changed, 7 insertions, 7 deletions
diff --git a/hw/usb/combined-packet.c b/hw/usb/combined-packet.c
index 01a7ed0..fc98383 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 b19b576..68c5eb8 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 8d44d48..e233681 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 cd30b5d..d660170 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 836b11f..26f123e 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