summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-12-06 11:58:10 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-01-11 15:46:55 +0100
commitb58deb344ddff3b9d8b265bf73a65274767ee5f4 (patch)
treeb311a114fbe0b2bfcd7d5b2001f7db3699f6fa6a /hw
parent10ca76b4d2075154b3d3e0ea3ab3dd17da71b11c (diff)
qemu/queue.h: leave head structs anonymous unless necessary
Most list head structs need not be given a name. In most cases the name is given just in case one is going to use QTAILQ_LAST, QTAILQ_PREV or reverse iteration, but this does not apply to lists of other kinds, and even for QTAILQ in practice this is only rarely needed. In addition, we will soon reimplement those macros completely so that they do not need a name for the head struct. So clean up everything, not giving a name except in the rare case where it is necessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/nvme.h8
-rw-r--r--hw/block/xen_disk.c6
-rw-r--r--hw/core/reset.c2
-rw-r--r--hw/i386/xen/xen-mapcache.c2
-rw-r--r--hw/ppc/spapr_iommu.c2
-rw-r--r--hw/usb/ccid-card-emulated.c4
-rw-r--r--hw/usb/dev-network.c2
-rw-r--r--hw/usb/xen-usb.c6
-rw-r--r--hw/watchdog/watchdog.c2
-rw-r--r--hw/xen/xen_pvdev.c4
10 files changed, 19 insertions, 19 deletions
diff --git a/hw/block/nvme.h b/hw/block/nvme.h
index cabcf20c32..56c9d4b4b1 100644
--- a/hw/block/nvme.h
+++ b/hw/block/nvme.h
@@ -29,8 +29,8 @@ typedef struct NvmeSQueue {
uint64_t dma_addr;
QEMUTimer *timer;
NvmeRequest *io_req;
- QTAILQ_HEAD(sq_req_list, NvmeRequest) req_list;
- QTAILQ_HEAD(out_req_list, NvmeRequest) out_req_list;
+ QTAILQ_HEAD(, NvmeRequest) req_list;
+ QTAILQ_HEAD(, NvmeRequest) out_req_list;
QTAILQ_ENTRY(NvmeSQueue) entry;
} NvmeSQueue;
@@ -45,8 +45,8 @@ typedef struct NvmeCQueue {
uint32_t size;
uint64_t dma_addr;
QEMUTimer *timer;
- QTAILQ_HEAD(sq_list, NvmeSQueue) sq_list;
- QTAILQ_HEAD(cq_req_list, NvmeRequest) req_list;
+ QTAILQ_HEAD(, NvmeSQueue) sq_list;
+ QTAILQ_HEAD(, NvmeRequest) req_list;
} NvmeCQueue;
typedef struct NvmeNamespace {
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 36eff94f84..2a254b99d0 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -82,9 +82,9 @@ struct XenBlkDev {
int more_work;
/* request lists */
- QLIST_HEAD(inflight_head, ioreq) inflight;
- QLIST_HEAD(finished_head, ioreq) finished;
- QLIST_HEAD(freelist_head, ioreq) freelist;
+ QLIST_HEAD(, ioreq) inflight;
+ QLIST_HEAD(, ioreq) finished;
+ QLIST_HEAD(, ioreq) freelist;
int requests_total;
int requests_inflight;
int requests_finished;
diff --git a/hw/core/reset.c b/hw/core/reset.c
index 84c8869371..9c477f2bf5 100644
--- a/hw/core/reset.c
+++ b/hw/core/reset.c
@@ -35,7 +35,7 @@ typedef struct QEMUResetEntry {
void *opaque;
} QEMUResetEntry;
-static QTAILQ_HEAD(reset_handlers, QEMUResetEntry) reset_handlers =
+static QTAILQ_HEAD(, QEMUResetEntry) reset_handlers =
QTAILQ_HEAD_INITIALIZER(reset_handlers);
void qemu_register_reset(QEMUResetHandler *func, void *opaque)
diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
index 4e4f069a24..02e823c5a2 100644
--- a/hw/i386/xen/xen-mapcache.c
+++ b/hw/i386/xen/xen-mapcache.c
@@ -71,7 +71,7 @@ typedef struct MapCacheRev {
typedef struct MapCache {
MapCacheEntry *entry;
unsigned long nr_buckets;
- QTAILQ_HEAD(map_cache_head, MapCacheRev) locked_entries;
+ QTAILQ_HEAD(, MapCacheRev) locked_entries;
/* For most cases (>99.9%), the page address is the same. */
MapCacheEntry *last_entry;
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index b56466f89a..37e98f9321 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -42,7 +42,7 @@ enum sPAPRTCEAccess {
#define IOMMU_PAGE_SIZE(shift) (1ULL << (shift))
#define IOMMU_PAGE_MASK(shift) (~(IOMMU_PAGE_SIZE(shift) - 1))
-static QLIST_HEAD(spapr_tce_tables, sPAPRTCETable) spapr_tce_tables;
+static QLIST_HEAD(, sPAPRTCETable) spapr_tce_tables;
sPAPRTCETable *spapr_tce_find_by_liobn(target_ulong liobn)
{
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index e0457d305b..963373ba95 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -119,11 +119,11 @@ struct EmulatedState {
char *db;
uint8_t atr[MAX_ATR_SIZE];
uint8_t atr_length;
- QSIMPLEQ_HEAD(event_list, EmulEvent) event_list;
+ QSIMPLEQ_HEAD(, EmulEvent) event_list;
QemuMutex event_list_mutex;
QemuThread event_thread_id;
VReader *reader;
- QSIMPLEQ_HEAD(guest_apdu_list, EmulEvent) guest_apdu_list;
+ QSIMPLEQ_HEAD(, EmulEvent) guest_apdu_list;
QemuMutex vreader_mutex; /* and guest_apdu_list mutex */
QemuMutex handle_apdu_mutex;
QemuCond handle_apdu_cond;
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 385e090336..ffab3fabee 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -648,7 +648,7 @@ typedef struct USBNetState {
char usbstring_mac[13];
NICState *nic;
NICConf conf;
- QTAILQ_HEAD(rndis_resp_head, rndis_response) rndis_resp;
+ QTAILQ_HEAD(, rndis_response) rndis_resp;
} USBNetState;
#define TYPE_USB_NET "usb-net"
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index f5d5c91094..5758a105a2 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -72,7 +72,7 @@ struct usbback_stub {
USBPort port;
unsigned int speed;
bool attached;
- QTAILQ_HEAD(submit_q_head, usbback_req) submit_q;
+ QTAILQ_HEAD(, usbback_req) submit_q;
};
struct usbback_req {
@@ -108,8 +108,8 @@ struct usbback_info {
int num_ports;
int usb_ver;
bool ring_error;
- QTAILQ_HEAD(req_free_q_head, usbback_req) req_free_q;
- QSIMPLEQ_HEAD(hotplug_q_head, usbback_hotplug) hotplug_q;
+ QTAILQ_HEAD(, usbback_req) req_free_q;
+ QSIMPLEQ_HEAD(, usbback_hotplug) hotplug_q;
struct usbback_stub ports[USBBACK_MAXPORTS];
struct usbback_stub *addr_table[USB_DEV_ADDR_SIZE];
QEMUBH *bh;
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 33e6c20184..dce7c1db14 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -32,7 +32,7 @@
#include "qemu/help_option.h"
static WatchdogAction watchdog_action = WATCHDOG_ACTION_RESET;
-static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
+static QLIST_HEAD(, WatchdogTimerModel) watchdog_list;
void watchdog_add_model(WatchdogTimerModel *model)
{
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index aed783e844..f026556f62 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -31,10 +31,10 @@ struct xs_dirs {
QTAILQ_ENTRY(xs_dirs) list;
};
-static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
+static QTAILQ_HEAD(, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
+static QTAILQ_HEAD(, XenDevice) xendevs =
QTAILQ_HEAD_INITIALIZER(xendevs);
/* ------------------------------------------------------------- */