summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Weil2015-03-08 19:30:01 +0100
committerMichael Tokarev2015-03-19 09:11:55 +0100
commite7ae771f6de2c7b3fa87823f87d6e10caeb91ec6 (patch)
treec5758affc249a4fe0b3ccd8b449d9a1941ce142e
parentqom: Fix warning from Sparse (diff)
downloadqemu-e7ae771f6de2c7b3fa87823f87d6e10caeb91ec6.tar.gz
qemu-e7ae771f6de2c7b3fa87823f87d6e10caeb91ec6.tar.xz
qemu-e7ae771f6de2c7b3fa87823f87d6e10caeb91ec6.zip
Fix remaining warnings from Sparse (void return)
Sparse report: hw/display/vga.c:2000:5: warning: returning void-valued expression hw/intc/arm_gic.c:707:9: warning: returning void-valued expression hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression include/qom/cpu.h:584:5: warning: returning void-valued expression monitor.c:4686:13: warning: returning void-valued expression monitor.c:4690:13: warning: returning void-valued expression Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Andreas Färber <afaerber@suse.de> Cc: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--hw/display/vga.c2
-rw-r--r--hw/intc/arm_gic.c3
-rw-r--r--hw/intc/etraxfs_pic.c8
-rw-r--r--hw/nvram/fw_cfg.c2
-rw-r--r--hw/timer/a9gtimer.c2
-rw-r--r--hw/tpm/tpm_tis.c2
-rw-r--r--hw/usb/hcd-musb.c20
-rw-r--r--include/qom/cpu.h2
-rw-r--r--monitor.c8
9 files changed, 28 insertions, 21 deletions
diff --git a/hw/display/vga.c b/hw/display/vga.c
index c0f7b343bb..d1d296c74e 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -1997,7 +1997,7 @@ static void vga_mem_write(void *opaque, hwaddr addr,
{
VGACommonState *s = opaque;
- return vga_mem_writeb(s, addr, data);
+ vga_mem_writeb(s, addr, data);
}
const MemoryRegionOps vga_mem_ops = {
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index 270ce05b58..a04c822832 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -704,7 +704,8 @@ static void gic_cpu_write(GICState *s, int cpu, int offset, uint32_t value)
s->bpr[cpu] = (value & 0x7);
break;
case 0x10: /* End Of Interrupt */
- return gic_complete_irq(s, cpu, value & 0x3ff);
+ gic_complete_irq(s, cpu, value & 0x3ff);
+ return;
case 0x1c: /* Aliased Binary Point */
if (s->revision >= 2) {
s->abpr[cpu] = (value & 0x7);
diff --git a/hw/intc/etraxfs_pic.c b/hw/intc/etraxfs_pic.c
index 636262b49f..bd588681ef 100644
--- a/hw/intc/etraxfs_pic.c
+++ b/hw/intc/etraxfs_pic.c
@@ -131,11 +131,13 @@ static void nmi_handler(void *opaque, int irq, int level)
}
static void irq_handler(void *opaque, int irq, int level)
-{
+{
struct etrax_pic *fs = (void *)opaque;
- if (irq >= 30)
- return nmi_handler(opaque, irq, level);
+ if (irq >= 30) {
+ nmi_handler(opaque, irq, level);
+ return;
+ }
irq -= 1;
fs->regs[R_R_VECT] &= ~(1 << irq);
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 78a37be42b..4caf5364da 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -472,7 +472,7 @@ void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value)
{
size_t sz = strlen(value) + 1;
- return fw_cfg_add_bytes(s, key, g_memdup(value, sz), sz);
+ fw_cfg_add_bytes(s, key, g_memdup(value, sz), sz);
}
void fw_cfg_add_i16(FWCfgState *s, uint16_t key, uint16_t value)
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index b087bbddb8..dd4aae8b3a 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -121,7 +121,7 @@ static void a9_gtimer_update_no_sync(void *opaque)
{
A9GTimerState *s = A9_GTIMER(opaque);
- return a9_gtimer_update(s, false);
+ a9_gtimer_update(s, false);
}
static uint64_t a9_gtimer_read(void *opaque, hwaddr addr, unsigned size)
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 9084ca439e..815c8eace1 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -868,7 +868,7 @@ static void tpm_tis_mmio_write_intern(void *opaque, hwaddr addr,
static void tpm_tis_mmio_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
- return tpm_tis_mmio_write_intern(opaque, addr, val, size, false);
+ tpm_tis_mmio_write_intern(opaque, addr, val, size, false);
}
static const MemoryRegionOps tpm_tis_memory_ops = {
diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c
index 40809f610e..61cc87894e 100644
--- a/hw/usb/hcd-musb.c
+++ b/hw/usb/hcd-musb.c
@@ -554,8 +554,10 @@ static void musb_schedule_cb(USBPort *port, USBPacket *packey)
timeout = ep->timeout[dir];
else if (ep->interrupt[dir])
timeout = 8;
- else
- return musb_cb_tick(ep);
+ else {
+ musb_cb_tick(ep);
+ return;
+ }
if (!ep->intv_timer[dir])
ep->intv_timer[dir] = timer_new_ns(QEMU_CLOCK_VIRTUAL, musb_cb_tick, ep);
@@ -772,9 +774,11 @@ static void musb_rx_packet_complete(USBPacket *packey, void *opaque)
/* NAK timeouts are only generated in Bulk transfers and
* Data-errors in Isochronous. */
- if (ep->interrupt[1])
- return musb_packet(s, ep, epnum, USB_TOKEN_IN,
- packey->iov.size, musb_rx_packet_complete, 1);
+ if (ep->interrupt[1]) {
+ musb_packet(s, ep, epnum, USB_TOKEN_IN,
+ packey->iov.size, musb_rx_packet_complete, 1);
+ return;
+ }
ep->csr[1] |= MGC_M_RXCSR_DATAERROR;
if (!epnum)
@@ -864,8 +868,7 @@ static void musb_tx_rdy(MUSBState *s, int epnum)
* but it doesn't make sense for us to do that. */
}
- return musb_packet(s, ep, epnum, pid,
- total, musb_tx_packet_complete, 0);
+ musb_packet(s, ep, epnum, pid, total, musb_tx_packet_complete, 0);
}
static void musb_rx_req(MUSBState *s, int epnum)
@@ -929,8 +932,7 @@ static void musb_rx_req(MUSBState *s, int epnum)
}
#endif
- return musb_packet(s, ep, epnum, USB_TOKEN_IN,
- total, musb_rx_packet_complete, 1);
+ musb_packet(s, ep, epnum, USB_TOKEN_IN, total, musb_rx_packet_complete, 1);
}
static uint8_t musb_read_fifo(MUSBEndPoint *ep)
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index d6279c01f5..9dafb4817e 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -593,7 +593,7 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
{
CPUClass *cc = CPU_GET_CLASS(cpu);
- return cc->do_unaligned_access(cpu, addr, is_write, is_user, retaddr);
+ cc->do_unaligned_access(cpu, addr, is_write, is_user, retaddr);
}
#endif
diff --git a/monitor.c b/monitor.c
index 42116a942e..f7e473981a 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4691,11 +4691,13 @@ static void monitor_find_completion_by_table(Monitor *mon,
if (cmd->sub_table) {
/* do the job again */
- return monitor_find_completion_by_table(mon, cmd->sub_table,
- &args[1], nb_args - 1);
+ monitor_find_completion_by_table(mon, cmd->sub_table,
+ &args[1], nb_args - 1);
+ return;
}
if (cmd->command_completion) {
- return cmd->command_completion(mon->rs, nb_args, args[nb_args - 1]);
+ cmd->command_completion(mon->rs, nb_args, args[nb_args - 1]);
+ return;
}
ptype = next_arg_type(cmd->args_type);