aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYurii Zubrytskyi <zyy@google.com>2016-08-25 15:31:03 -0700
committerDavid 'Digit' Turner <digit@google.com>2016-11-15 19:37:10 +0100
commitb01ff82c62ca6174b813ca604e3e253254632756 (patch)
tree2b3489d64ba67d258b4526fc09fdb0f081179a13
parent7ee59da7fcb6658edd6d5de65e36915792e93843 (diff)
downloadqemu-android-2.7.0.tar.gz
[qemu2] Fix all 'unused variable' warnings for assert-only varsqemu-android-2.7.0
This is a back-port from emu-master-dev Change-Id: Ia82a2b5e384c489a73dbc33fd584c7f96bb4996a
-rw-r--r--block.c1
-rw-r--r--exec.c5
-rw-r--r--hw/char/cadence_uart.c1
-rw-r--r--hw/core/qdev-properties.c1
-rw-r--r--hw/i386/kvm/pci-assign.c1
-rw-r--r--hw/misc/pci-testdev.c1
-rw-r--r--hw/net/eepro100.c1
-rw-r--r--hw/net/virtio-net.c2
-rw-r--r--hw/net/vmxnet3.c1
-rw-r--r--hw/pci/msi.c1
-rw-r--r--hw/pci/msix.c1
-rw-r--r--hw/pci/pci.c1
-rw-r--r--hw/pci/pcie.c1
-rw-r--r--hw/pci/pcie_aer.c1
-rw-r--r--hw/scsi/lsi53c895a.c1
-rw-r--r--hw/scsi/scsi-disk.c2
-rw-r--r--hw/scsi/virtio-scsi.c5
-rw-r--r--hw/scsi/vmw_pvscsi.c2
-rw-r--r--hw/usb/hcd-xhci.c1
-rw-r--r--hw/virtio/vhost.c4
-rw-r--r--hw/virtio/virtio-pci.c1
-rw-r--r--hw/virtio/virtio.c1
-rw-r--r--kvm-all.c1
-rw-r--r--net/dump.c1
-rw-r--r--qapi/qapi-dealloc-visitor.c1
-rw-r--r--qemu-char.c1
-rw-r--r--qobject/qdict.c2
-rw-r--r--target-arm/helper.c2
-rw-r--r--target-mips/msa_helper.c8
-rw-r--r--util/iov.c1
-rw-r--r--util/qemu-option.c3
31 files changed, 51 insertions, 5 deletions
diff --git a/block.c b/block.c
index 30d64e6ca5..8efa999087 100644
--- a/block.c
+++ b/block.c
@@ -1042,6 +1042,7 @@ static QDict *parse_json_filename(const char *filename, Error **errp)
ret = strstart(filename, "json:", &filename);
assert(ret);
+ (void)ret;
options_obj = qobject_from_json(filename);
if (!options_obj) {
diff --git a/exec.c b/exec.c
index e51bc5ed1a..00f1f6471a 100644
--- a/exec.c
+++ b/exec.c
@@ -976,6 +976,7 @@ static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length)
rcu_read_lock();
block = qemu_get_ram_block(start);
assert(block == qemu_get_ram_block(end - 1));
+ (void)end;
start1 = (uintptr_t)ramblock_ptr(block, start - block->offset);
CPU_FOREACH(cpu) {
tlb_reset_dirty(cpu, start1, length);
@@ -2318,12 +2319,16 @@ static void mem_begin(MemoryListener *listener)
n = dummy_section(&d->map, as, &io_mem_unassigned);
assert(n == PHYS_SECTION_UNASSIGNED);
+ (void)n;
n = dummy_section(&d->map, as, &io_mem_notdirty);
assert(n == PHYS_SECTION_NOTDIRTY);
+ (void)n;
n = dummy_section(&d->map, as, &io_mem_rom);
assert(n == PHYS_SECTION_ROM);
+ (void)n;
n = dummy_section(&d->map, as, &io_mem_watch);
assert(n == PHYS_SECTION_WATCH);
+ (void)n;
d->phys_map = (PhysPageEntry) { .ptr = PHYS_MAP_NODE_NIL, .skip = 1 };
d->as = as;
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index e3bc52f7df..cab8a6a0b9 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -301,6 +301,7 @@ static gboolean cadence_uart_xmit(GIOChannel *chan, GIOCondition cond,
s->tx_count = 0;
return FALSE;
}
+ (void)r;
}
uart_update_status(s);
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 311af6da76..e31d30c0cd 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -712,6 +712,7 @@ static void get_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
rc = snprintf(buffer, sizeof(buffer), "%04x:%02x:%02x.%d",
addr->domain, addr->bus, addr->slot, addr->function);
assert(rc == sizeof(buffer) - 1);
+ (void)rc;
visit_type_str(v, name, &p, errp);
}
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 0f86417423..e197ddc6bf 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -929,6 +929,7 @@ static void deassign_device(AssignedDevice *dev)
r = kvm_device_pci_deassign(kvm_state, dev->dev_id);
assert(r == 0);
+ (void)r;
}
/* The pci config space got updated. Check if irq numbers have changed
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 7d5990213e..abfc2df4e7 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -279,6 +279,7 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp)
}
r = event_notifier_init(&test->notifier, 0);
assert(r >= 0);
+ (void)r;
test->hasnotifier = true;
}
}
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index bab4dbfc98..390c297ebd 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -572,6 +572,7 @@ static void e100_pci_reset(EEPRO100State * s)
int r = pci_add_capability(&s->dev, PCI_CAP_ID_PM,
cfg_offset, PCI_PM_SIZEOF);
assert(r >= 0);
+ (void)r;
pci_set_word(pci_conf + cfg_offset + PCI_PM_PMC, 0x7e21);
#if 0 /* TODO: replace dummy code for power management emulation. */
/* TODO: Power Management Control / Status. */
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 01f1351554..b8cf936c9b 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -507,9 +507,11 @@ static void virtio_net_set_queues(VirtIONet *n)
if (i < n->curr_queues) {
r = peer_attach(n, i);
assert(!r);
+ (void)r;
} else {
r = peer_detach(n, i);
assert(!r);
+ (void)r;
}
}
}
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 90f6943668..d67d83cbf6 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1517,6 +1517,7 @@ static void vmxnet3_activate_device(VMXNET3State *s)
s->event_int_idx =
VMXNET3_READ_DRV_SHARED8(d, s->drv_shmem, devRead.intrConf.eventIntrIdx);
assert(vmxnet3_verify_intx(s, s->event_int_idx));
+ (void)vmxnet3_verify_intx;
VMW_CFPRN("Events interrupt line is %u", s->event_int_idx);
s->auto_int_masking =
diff --git a/hw/pci/msi.c b/hw/pci/msi.c
index a87b2278a3..c328a6c5d7 100644
--- a/hw/pci/msi.c
+++ b/hw/pci/msi.c
@@ -315,6 +315,7 @@ void msi_notify(PCIDevice *dev, unsigned int vector)
MSIMessage msg;
assert(vector < nr_vectors);
+ (void)nr_vectors;
if (msi_is_masked(dev, vector)) {
assert(flags & PCI_MSI_FLAGS_MASKBIT);
pci_long_test_and_set_mask(
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 0ec1cb14fc..ab457b0e78 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -110,6 +110,7 @@ static void msix_fire_vector_notifier(PCIDevice *dev,
msg = msix_get_message(dev, vector);
ret = dev->msix_vector_use_notifier(dev, vector, msg);
assert(ret >= 0);
+ (void)ret;
}
}
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 24fae1689d..32d9df4ea3 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2433,6 +2433,7 @@ static char *pcibus_get_dev_path(DeviceState *dev)
s = snprintf(slot, sizeof slot, ":%02x.%x",
PCI_SLOT(t->devfn), PCI_FUNC(t->devfn));
assert(s == slot_len);
+ (void)s;
memcpy(p, slot, slot_len);
}
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 99cfb4561b..2c29af1d44 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -417,6 +417,7 @@ void pcie_cap_slot_reset(PCIDevice *dev)
assert(port_type == PCI_EXP_TYPE_DOWNSTREAM ||
port_type == PCI_EXP_TYPE_ROOT_PORT);
+ (void)port_type;
PCIE_DEV_PRINTF(dev, "reset\n");
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 048ce6a424..6f87e3c87d 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -702,6 +702,7 @@ int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
};
int ret = pcie_aer_inject_error(dev, &header_log_overflow);
assert(!ret);
+ (void)ret;
}
return 0;
}
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index df205cdafe..dbaf4d41cd 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -549,6 +549,7 @@ static void lsi_do_dma(LSIState *s, int out)
pci_dev = PCI_DEVICE(s);
dev = s->current->req->dev;
assert(dev);
+ (void)dev;
count = s->dbc;
if (count > s->current->dma_len)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 836a1553ed..d8c736bb3e 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -288,6 +288,7 @@ static void scsi_dma_complete(void *opaque, int ret)
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
assert(r->req.aiocb != NULL);
+ (void)r;
r->req.aiocb = NULL;
if (ret < 0) {
@@ -1422,6 +1423,7 @@ static int scsi_disk_check_mode_select(SCSIDiskState *s, int page,
memset(mode_changeable, 0, inlen + 2);
changeable_len = mode_sense_page(s, page, &p, 1);
assert(changeable_len == len);
+ (void)changeable_len;
/* Check that unchangeable bits are the same as what MODE SENSE
* would return.
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index ce57ef6248..db64574c67 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -188,6 +188,7 @@ static void virtio_scsi_save_request(QEMUFile *f, SCSIRequest *sreq)
uint32_t n = virtio_get_queue_index(req->vq) - 2;
assert(n < vs->conf.num_queues);
+ (void)vs;
qemu_put_be32s(f, &n);
qemu_put_virtqueue_element(f, &req->elem);
}
@@ -214,7 +215,9 @@ static void *virtio_scsi_load_request(QEMUFile *f, SCSIRequest *sreq)
scsi_req_ref(sreq);
req->sreq = sreq;
if (req->sreq->cmd.mode != SCSI_XFER_NONE) {
- assert(req->sreq->cmd.mode == req->mode);
+ if (!(req->sreq->cmd.mode == req->mode)) {
+ abort();
+ }
}
return req;
}
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 5116f4ad68..d6a91e1722 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -957,6 +957,7 @@ pvscsi_on_command_data(PVSCSIState *s, uint32_t value)
size_t bytes_arrived = s->curr_cmd_data_cntr * sizeof(uint32_t);
assert(bytes_arrived < sizeof(s->curr_cmd_data));
+ (void)bytes_arrived;
s->curr_cmd_data[s->curr_cmd_data_cntr++] = value;
pvscsi_do_command_processing(s);
@@ -1179,6 +1180,7 @@ pvscsi_pre_save(void *opaque)
assert(QTAILQ_EMPTY(&s->pending_queue));
assert(QTAILQ_EMPTY(&s->completion_queue));
+ (void)s;
}
static int
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 450849b7d4..29bfd839c9 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3668,6 +3668,7 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) {
ret = pcie_endpoint_cap_init(dev, 0xa0);
assert(ret >= 0);
+ (void)ret;
}
if (xhci->msix != ON_OFF_AUTO_OFF) {
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 3d0c807d0e..676d893b05 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -578,6 +578,7 @@ static void vhost_commit(MemoryListener *listener)
r = vhost_verify_ring_mappings(dev, start_addr, size);
assert(r >= 0);
+ (void)r;
}
if (!dev->log_enabled) {
@@ -585,6 +586,7 @@ static void vhost_commit(MemoryListener *listener)
if (r < 0) {
VHOST_OPS_DEBUG("vhost_set_mem_table failed");
}
+ (void)r;
dev->memory_changed = false;
return;
}
@@ -600,6 +602,7 @@ static void vhost_commit(MemoryListener *listener)
if (r < 0) {
VHOST_OPS_DEBUG("vhost_set_mem_table failed");
}
+ (void)r;
/* To log less, can only decrease log size after table update. */
if (dev->log_size > log_size + VHOST_LOG_BUFFER) {
vhost_dev_log_resize(dev, log_size);
@@ -1258,6 +1261,7 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
if (r < 0) {
VHOST_OPS_DEBUG("vhost_set_vring_call failed");
}
+ (void)r;
}
uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bits,
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 755f9218b7..75697fccfe 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -747,6 +747,7 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy,
ret = kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, n, irqfd->virq);
assert(ret == 0);
+ (void)ret;
}
static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 74c085c74d..db90a31210 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1089,6 +1089,7 @@ void virtio_queue_set_align(VirtIODevice *vdev, int n, int align)
* silently failing to migrate this state)
*/
assert(k->has_variable_vring_alignment);
+ (void)k;
vdev->vq[n].vring.align = align;
virtio_queue_update_rings(vdev, n);
diff --git a/kvm-all.c b/kvm-all.c
index 150aa20a5e..8de8f71eb7 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1051,6 +1051,7 @@ void kvm_irqchip_commit_routes(KVMState *s)
trace_kvm_irqchip_commit_routes();
ret = kvm_vm_ioctl(s, KVM_SET_GSI_ROUTING, s->irq_routes);
assert(ret == 0);
+ (void)ret;
}
static void kvm_add_routing_entry(KVMState *s,
diff --git a/net/dump.c b/net/dump.c
index 89a149b5dd..219d8d03dc 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -202,6 +202,7 @@ int net_init_dump(const Netdev *netdev, const char *name,
ret = net_hub_id_for_client(peer, &id);
assert(ret == 0); /* peer must be on a hub */
+ (void)ret;
snprintf(def_file, sizeof(def_file), "qemu-vlan%d.pcap", id);
file = def_file;
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index e39457bc79..11b7c85edd 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -65,6 +65,7 @@ static GenericList *qapi_dealloc_next_list(Visitor *v, GenericList *tail,
static void qapi_dealloc_end_list(Visitor *v, void **obj)
{
+ (void)obj;
}
static void qapi_dealloc_type_str(Visitor *v, const char *name, char **obj,
diff --git a/qemu-char.c b/qemu-char.c
index 9fb023d94d..71a78bc4f8 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -900,6 +900,7 @@ static void io_watch_poll_finalize(GSource *source)
*/
IOWatchPoll *iwp = io_watch_poll_from_source(source);
assert(iwp->src == NULL);
+ (void)iwp;
}
static GSourceFuncs io_watch_poll_funcs = {
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 60f158c3b7..6d66255da6 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -656,11 +656,13 @@ void qdict_array_split(QDict *src, QList **dst)
snprintf_ret = snprintf(indexstr, 32, "%u", i);
assert(snprintf_ret < 32);
+ (void)snprintf_ret;
subqobj = qdict_get(src, indexstr);
snprintf_ret = snprintf(prefix, 32, "%u.", i);
assert(snprintf_ret < 32);
+ (void)snprintf_ret;
/* Overflow is the same as positive non-zero results */
is_subqdict = qdict_count_prefixed_entries(src, prefix);
diff --git a/target-arm/helper.c b/target-arm/helper.c
index bdb842cc45..addd0429a8 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -4334,6 +4334,7 @@ static void define_debug_regs(ARMCPU *cpu)
ctx_cmps = extract32(cpu->dbgdidr, 20, 4);
assert(ctx_cmps <= brps);
+ (void)ctx_cmps;
/* The DBGDIDR and ID_AA64DFR0_EL1 define various properties
* of the debug registers such as number of breakpoints;
@@ -5418,6 +5419,7 @@ void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu,
}
/* assert our permissions are not too lax (stricter is fine) */
assert((r->access & ~mask) == 0);
+ (void)mask;
}
/* Check that the register definition has enough info to handle
diff --git a/target-mips/msa_helper.c b/target-mips/msa_helper.c
index 1fdb0d9792..a8d8d091a9 100644
--- a/target-mips/msa_helper.c
+++ b/target-mips/msa_helper.c
@@ -91,7 +91,7 @@ void helper_msa_shf_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
{
wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
wr_t *pws = &(env->active_fpu.fpr[ws].wr);
- wr_t wx, *pwx = &wx;
+ wr_t wx = {}, *pwx = &wx;
uint32_t i;
switch (df) {
@@ -1130,7 +1130,7 @@ void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df, uint32_t wd, \
wr_t *pwd = &(env->active_fpu.fpr[wd].wr); \
wr_t *pws = &(env->active_fpu.fpr[ws].wr); \
wr_t *pwt = &(env->active_fpu.fpr[wt].wr); \
- wr_t wx, *pwx = &wx; \
+ wr_t wx = {}, *pwx = &wx; \
uint32_t i; \
switch (df) { \
case DF_BYTE: \
@@ -3395,7 +3395,7 @@ void helper_msa_ftint_u_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
void helper_msa_ffint_s_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
uint32_t ws)
{
- wr_t wx, *pwx = &wx;
+ wr_t wx = {}, *pwx = &wx;
wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
wr_t *pws = &(env->active_fpu.fpr[ws].wr);
uint32_t i;
@@ -3425,7 +3425,7 @@ void helper_msa_ffint_s_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
void helper_msa_ffint_u_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
uint32_t ws)
{
- wr_t wx, *pwx = &wx;
+ wr_t wx = {}, *pwx = &wx;
wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
wr_t *pws = &(env->active_fpu.fpr[ws].wr);
uint32_t i;
diff --git a/util/iov.c b/util/iov.c
index 74e6ca8ed7..dc12bab545 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -575,6 +575,7 @@ void qemu_iovec_discard_back(QEMUIOVector *qiov, size_t bytes)
assert(qiov->size >= bytes);
total = iov_discard_back(qiov->iov, &niov, bytes);
assert(total == bytes);
+ (void)total;
qiov->niov = niov;
qiov->size -= bytes;
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 3467dc2397..135242ae33 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -933,6 +933,7 @@ void qemu_opts_set_defaults(QemuOptsList *list, const char *params,
opts = opts_parse(list, params, permit_abbrev, true, NULL);
assert(opts);
+ (void)opts;
}
typedef struct OptsFromQDictState {
@@ -959,12 +960,14 @@ static void qemu_opts_from_qdict_1(const char *key, QObject *obj, void *opaque)
n = snprintf(buf, sizeof(buf), "%" PRId64,
qint_get_int(qobject_to_qint(obj)));
assert(n < sizeof(buf));
+ (void)n;
value = buf;
break;
case QTYPE_QFLOAT:
n = snprintf(buf, sizeof(buf), "%.17g",
qfloat_get_double(qobject_to_qfloat(obj)));
assert(n < sizeof(buf));
+ (void)n;
value = buf;
break;
case QTYPE_QBOOL: