All of lore.kernel.org
 help / color / mirror / Atom feed
From: blauwirbel@gmail.com
To: qemu-devel@nongnu.org
Cc: blueswirl@gmail.com
Subject: [Qemu-devel] [PATCH 2/5] Avoid returning void
Date: Sun,  8 Jul 2012 11:51:27 +0000	[thread overview]
Message-ID: <4da2aa5808a9495fef00df2e05b5448923929def.1341748181.git.blauwirbel@gmail.com> (raw)
In-Reply-To: <cover.1341748181.git.blauwirbel@gmail.com>
In-Reply-To: <cover.1341748181.git.blauwirbel@gmail.com>

From: Blue Swirl <blauwirbel@gmail.com>

It's silly and non-conforming to standards to return void,
don't do it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 block.c                |    2 +-
 dma.h                  |    6 +++---
 hw/bt-l2cap.c          |   11 +++++++----
 hw/eepro100.c          |   15 +++++++++++----
 hw/ide/cmd646.c        |    6 +++---
 hw/ide/piix.c          |    3 ++-
 hw/ide/via.c           |    3 ++-
 hw/lan9118.c           |    6 ++++--
 hw/ne2000.c            |    8 ++++----
 hw/vmware_vga.c        |    9 ++++++---
 ui/vnc-auth-vencrypt.c |    3 ++-
 ui/vnc.c               |    2 +-
 12 files changed, 46 insertions(+), 28 deletions(-)

diff --git a/block.c b/block.c
index 1474633..14e91a1 100644
--- a/block.c
+++ b/block.c
@@ -2832,7 +2832,7 @@ void bdrv_debug_event(BlockDriverState *bs, BlkDebugEvent event)
         return;
     }
 
-    return drv->bdrv_debug_event(bs, event);
+    drv->bdrv_debug_event(bs, event);
 
 }
 
diff --git a/dma.h b/dma.h
index acacf1b..f35c4b6 100644
--- a/dma.h
+++ b/dma.h
@@ -196,9 +196,9 @@ static inline void dma_memory_unmap(DMAContext *dma,
                                     DMADirection dir, dma_addr_t access_len)
 {
     if (!dma_has_iommu(dma)) {
-        return cpu_physical_memory_unmap(buffer, (target_phys_addr_t)len,
-                                         dir == DMA_DIRECTION_FROM_DEVICE,
-                                         access_len);
+        cpu_physical_memory_unmap(buffer, (target_phys_addr_t)len,
+                                  dir == DMA_DIRECTION_FROM_DEVICE,
+                                  access_len);
     } else {
         iommu_dma_memory_unmap(dma, buffer, len, dir, access_len);
     }
diff --git a/hw/bt-l2cap.c b/hw/bt-l2cap.c
index 2ccba60..cb43ee7 100644
--- a/hw/bt-l2cap.c
+++ b/hw/bt-l2cap.c
@@ -1000,7 +1000,8 @@ static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
             /* TODO: Signal an error? */
             return;
         }
-        return l2cap_sframe_in(ch, le16_to_cpup((void *) hdr->data));
+        l2cap_sframe_in(ch, le16_to_cpup((void *) hdr->data));
+        return;
     }
 
     switch (hdr->data[1] >> 6) {	/* SAR */
@@ -1010,7 +1011,8 @@ static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
         if (len - 4 > ch->mps)
             goto len_error;
 
-        return ch->params.sdu_in(ch->params.opaque, hdr->data + 2, len - 4);
+        ch->params.sdu_in(ch->params.opaque, hdr->data + 2, len - 4);
+        break;
 
     case L2CAP_SAR_START:
         if (ch->len_total || len < 6)
@@ -1033,7 +1035,8 @@ static void l2cap_iframe_in(struct l2cap_chan_s *ch, uint16_t cid,
             goto len_error;
 
         memcpy(ch->sdu + ch->len_cur, hdr->data + 2, len - 4);
-        return ch->params.sdu_in(ch->params.opaque, ch->sdu, ch->len_total);
+        ch->params.sdu_in(ch->params.opaque, ch->sdu, ch->len_total);
+        break;
 
     case L2CAP_SAR_CONT:
         if (!ch->len_total || ch->len_cur + len - 4 >= ch->len_total)
@@ -1136,7 +1139,7 @@ static void l2cap_bframe_submit(struct bt_l2cap_conn_params_s *parms)
 {
     struct l2cap_chan_s *chan = (struct l2cap_chan_s *) parms;
 
-    return l2cap_pdu_submit(chan->l2cap);
+    l2cap_pdu_submit(chan->l2cap);
 }
 
 #if 0
diff --git a/hw/eepro100.c b/hw/eepro100.c
index 6279ae3..0f1f0f4 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -1596,10 +1596,17 @@ static void eepro100_write(void *opaque, target_phys_addr_t addr,
     EEPRO100State *s = opaque;
 
     switch (size) {
-    case 1: return eepro100_write1(s, addr, data);
-    case 2: return eepro100_write2(s, addr, data);
-    case 4: return eepro100_write4(s, addr, data);
-    default: abort();
+    case 1:
+        eepro100_write1(s, addr, data);
+        break;
+    case 2:
+        eepro100_write2(s, addr, data);
+        break;
+    case 4:
+        eepro100_write4(s, addr, data);
+        break;
+    default:
+        abort();
     }
 }
 
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index bf8ece4..087b4f9 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -94,12 +94,12 @@ static void cmd646_data_write(void *opaque, target_phys_addr_t addr,
     CMD646BAR *cmd646bar = opaque;
 
     if (size == 1) {
-        return ide_ioport_write(cmd646bar->bus, addr, data);
+        ide_ioport_write(cmd646bar->bus, addr, data);
     } else if (addr == 0) {
         if (size == 2) {
-            return ide_data_writew(cmd646bar->bus, addr, data);
+            ide_data_writew(cmd646bar->bus, addr, data);
         } else {
-            return ide_data_writel(cmd646bar->bus, addr, data);
+            ide_data_writel(cmd646bar->bus, addr, data);
         }
     }
 }
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index f5a74c2..6652761 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -73,7 +73,8 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr,
 #endif
     switch(addr & 3) {
     case 0:
-        return bmdma_cmd_writeb(bm, val);
+        bmdma_cmd_writeb(bm, val);
+        break;
     case 2:
         bm->status = (val & 0x60) | (bm->status & 1) | (bm->status & ~val & 0x06);
         break;
diff --git a/hw/ide/via.c b/hw/ide/via.c
index eec5136..a17f2e2 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -74,7 +74,8 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr,
 #endif
     switch (addr & 3) {
     case 0:
-        return bmdma_cmd_writeb(bm, val);
+        bmdma_cmd_writeb(bm, val);
+        break;
     case 2:
         bm->status = (val & 0x60) | (bm->status & 1) | (bm->status & ~val & 0x06);
         break;
diff --git a/hw/lan9118.c b/hw/lan9118.c
index 7b4fe87..0c354e9 100644
--- a/hw/lan9118.c
+++ b/hw/lan9118.c
@@ -1166,9 +1166,11 @@ static void lan9118_16bit_mode_write(void *opaque, target_phys_addr_t offset,
 {
     switch (size) {
     case 2:
-        return lan9118_writew(opaque, offset, (uint32_t)val);
+        lan9118_writew(opaque, offset, (uint32_t)val);
+        return;
     case 4:
-        return lan9118_writel(opaque, offset, val, size);
+        lan9118_writel(opaque, offset, val, size);
+        return;
     }
 
     hw_error("lan9118_write: Bad size 0x%x\n", size);
diff --git a/hw/ne2000.c b/hw/ne2000.c
index d02e60c..ccf7715 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -677,15 +677,15 @@ static void ne2000_write(void *opaque, target_phys_addr_t addr,
     NE2000State *s = opaque;
 
     if (addr < 0x10 && size == 1) {
-        return ne2000_ioport_write(s, addr, data);
+        ne2000_ioport_write(s, addr, data);
     } else if (addr == 0x10) {
         if (size <= 2) {
-            return ne2000_asic_ioport_write(s, addr, data);
+            ne2000_asic_ioport_write(s, addr, data);
         } else {
-            return ne2000_asic_ioport_writel(s, addr, data);
+            ne2000_asic_ioport_writel(s, addr, data);
         }
     } else if (addr == 0x1f && size == 1) {
-        return ne2000_reset_ioport_write(s, addr, data);
+        ne2000_reset_ioport_write(s, addr, data);
     }
 }
 
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 476dc89..f5e4f44 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1150,11 +1150,14 @@ static void vmsvga_io_write(void *opaque, target_phys_addr_t addr,
 
     switch (addr) {
     case SVGA_IO_MUL * SVGA_INDEX_PORT:
-        return vmsvga_index_write(s, addr, data);
+        vmsvga_index_write(s, addr, data);
+        break;
     case SVGA_IO_MUL * SVGA_VALUE_PORT:
-        return vmsvga_value_write(s, addr, data);
+        vmsvga_value_write(s, addr, data);
+        break;
     case SVGA_IO_MUL * SVGA_BIOS_PORT:
-        return vmsvga_bios_write(s, addr, data);
+        vmsvga_bios_write(s, addr, data);
+        break;
     }
 }
 
diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c
index 674ba97..c59b188 100644
--- a/ui/vnc-auth-vencrypt.c
+++ b/ui/vnc-auth-vencrypt.c
@@ -47,7 +47,8 @@ static void start_auth_vencrypt_subauth(VncState *vs)
     case VNC_AUTH_VENCRYPT_TLSSASL:
     case VNC_AUTH_VENCRYPT_X509SASL:
       VNC_DEBUG("Start TLS auth SASL\n");
-      return start_auth_sasl(vs);
+      start_auth_sasl(vs);
+      break;
 #endif /* CONFIG_VNC_SASL */
 
     default: /* Should not be possible, but just in case */
diff --git a/ui/vnc.c b/ui/vnc.c
index cf1cae2..cfc61a7 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3089,5 +3089,5 @@ void vnc_display_add_client(DisplayState *ds, int csock, int skipauth)
 {
     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
 
-    return vnc_connect(vs, csock, skipauth);
+    vnc_connect(vs, csock, skipauth);
 }
-- 
1.7.2.5

  parent reply	other threads:[~2012-07-08 11:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-08 11:51 [Qemu-devel] [PATCH 0/5] portability patches blauwirbel
2012-07-08 11:51 ` [Qemu-devel] [PATCH 1/5] Avoid GCC extension ?: blauwirbel
2012-07-08 12:09   ` Andreas Schwab
2012-07-08 12:14     ` Blue Swirl
2012-07-11 12:54     ` Kevin Wolf
2012-07-11 13:09       ` Peter Maydell
2012-07-11 13:12         ` 陳韋任 (Wei-Ren Chen)
2012-07-12 20:34           ` Blue Swirl
2012-07-12 20:28       ` Blue Swirl
2012-07-12 21:08         ` Peter Maydell
2012-07-13 14:47           ` Blue Swirl
2012-07-13  9:05         ` Kevin Wolf
2012-07-13 14:58           ` Blue Swirl
2012-07-09  7:35   ` Markus Armbruster
2012-07-10 19:09     ` Blue Swirl
2012-07-08 11:51 ` blauwirbel [this message]
2012-07-08 11:51 ` [Qemu-devel] [PATCH 3/5] Use __asm__ instead of asm or __asm blauwirbel
2012-07-08 11:51 ` [Qemu-devel] [PATCH 4/5] Avoid unportable %m format blauwirbel
2012-07-10 20:53   ` Anthony Liguori
2012-07-10 21:12     ` Stefan Weil
2012-07-10 21:23       ` Anthony Liguori
2012-07-12 19:43     ` Blue Swirl
2012-07-08 11:51 ` [Qemu-devel] [PATCH 5/5] Avoid redefining inline blauwirbel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4da2aa5808a9495fef00df2e05b5448923929def.1341748181.git.blauwirbel@gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=blueswirl@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.