Skip to contentSkip to conversation

trivial: Detect and remove superfluous semicolons in C code

PATCH RESEND Applied Philippe Mathieu-Daudé 10 participants 48 messages Feb 18, 2020 – Feb 20, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover trivial: Detect and remove superfluous semicolons in C code

Luc noticed a superfluous trailing semicolon:
https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg04593.html

Prevent that by modifying checkpatch.pl and clean the codebase.

Philippe Mathieu-Daudé (13):
scripts/checkpatch.pl: Detect superfluous semicolon in C code audio/alsaaudio: Remove superfluous semicolons
block: Remove superfluous semicolons block/io_uring: Remove superfluous semicolon hw/arm/xlnx-versal: Remove superfluous semicolon hw/m68k/next-cube: Remove superfluous semicolon hw/scsi/esp: Remove superfluous semicolon hw/vfio/display: Remove superfluous semicolon migration/multifd: Remove superfluous semicolon ui/input-barrier: Remove superfluous semicolon target/i386/whpx: Remove superfluous semicolon tests/qtest/libqos/qgraph: Remove superfluous semicolons contrib/rdmacm-mux: Remove superfluous semicolon

 audio/alsaaudio.c           | 4 ++--
 block.c                     | 4 ++--
 block/io_uring.c            | 2 +-
 contrib/rdmacm-mux/main.c   | 2 +-
 hw/arm/xlnx-versal-virt.c   | 2 +-
 hw/m68k/next-cube.c         | 2 +-
 hw/scsi/esp.c               | 2 +-
 hw/vfio/display.c           | 2 +-
 migration/multifd.c         | 2 +-
 target/i386/whpx-all.c      | 2 +-
 tests/qtest/libqos/qgraph.c | 4 ++--
 ui/input-barrier.c          | 2 +-
 scripts/checkpatch.pl       | 5 +++++
 13 files changed, 20 insertions(+), 15 deletions(-)
Signature · 1 line
2.21.1
#5 lore raw

PATCH RESEND 2/13 audio/alsaaudio: Remove superfluous semicolons

Fixes 286a5d201e4

---
Cc: "Kővágó, Zoltán" <[email protected]>

---
 audio/alsaaudio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
audio/alsaaudio.c +2 -2
index a23a5a0b60..a8e62542f9 100644
@@ -819,7 +819,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
             switch (nread) {
             case 0:
                 trace_alsa_read_zero(len);
-                return pos;;
+                return pos;
 
             case -EPIPE:
                 if (alsa_recover(alsa->handle)) {
@@ -835,7 +835,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
             default:
                 alsa_logerr(nread, "Failed to read %zu frames to %p\n",
                             len, dst);
-                return pos;;
+                return pos;
             }
         }
 
Signature · 1 line
2.21.1
#1 lore raw

PATCH RESEND 1/13 scripts/checkpatch.pl: Detect superfluous semicolon in C code

In reply to Philippe Mathieu-Daudé

Display error when a commit contains superfluous semicolon:

  $ git show 6663a0a3376 | scripts/checkpatch.pl -q -
  ERROR: superfluous trailing semicolon
  #276: FILE: block/io_uring.c:186:
  +                ret = -ENOSPC;;
  total: 1 errors, 1 warnings, 485 lines checked

---
Cc: Paolo Bonzini <[email protected]>

---
 scripts/checkpatch.pl | 5 +++++
 1 file changed, 5 insertions(+)
scripts/checkpatch.pl +5 -0
index ce43a306f8..11512a8a09 100755
@@ -1830,6 +1830,11 @@ sub process {
 			ERROR("suspicious ; after while (0)\n" . $herecurr);
 		}
 
+# Check superfluous trailing ';'
+		if ($line =~ /;;$/) {
+			ERROR("superfluous trailing semicolon\n" . $herecurr);
+		}
+
 # Check relative indent for conditionals and blocks.
 		if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
 			my ($s, $c) = ($stat, $cond);
Signature · 1 line
2.21.1
#8 lore raw

PATCH RESEND 3/13 block: Remove superfluous semicolons

In reply to Philippe Mathieu-Daudé
Fixes 132ada80c4a
---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block.c +2 -2
index 9c810534d6..9db0b973fe 100644
@@ -2435,13 +2435,13 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,
     if (bdrv_get_aio_context(child_bs) != ctx) {
         ret = bdrv_try_set_aio_context(child_bs, ctx, &local_err);
         if (ret < 0 && child_role->can_set_aio_ctx) {
-            GSList *ignore = g_slist_prepend(NULL, child);;
+            GSList *ignore = g_slist_prepend(NULL, child);
             ctx = bdrv_get_aio_context(child_bs);
             if (child_role->can_set_aio_ctx(child, ctx, &ignore, NULL)) {
                 error_free(local_err);
                 ret = 0;
                 g_slist_free(ignore);
-                ignore = g_slist_prepend(NULL, child);;
+                ignore = g_slist_prepend(NULL, child);
                 child_role->set_aio_ctx(child, ctx, &ignore);
             }
             g_slist_free(ignore);
Signature · 1 line
2.21.1
#11 lore raw

PATCH RESEND 4/13 block/io_uring: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 6663a0a3376

---
Cc: Stefano Garzarella <[email protected]>

---
 block/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/io_uring.c +1 -1
index 56892fd1ab..a3142ca989 100644
@@ -187,7 +187,7 @@ static void luring_process_completions(LuringState *s)
                     ret = 0;
                 }
             } else {
-                ret = -ENOSPC;;
+                ret = -ENOSPC;
             }
         }
 end:
Signature · 1 line
2.21.1
#16 lore raw

PATCH RESEND 5/13 hw/arm/xlnx-versal: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 6f16da53ffe
---
 hw/arm/xlnx-versal-virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/xlnx-versal-virt.c +1 -1
index 462493c467..0d2e3bdda1 100644
@@ -350,7 +350,7 @@ static void create_virtio_regions(VersalVirt *s)
     int i;
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
-        char *name = g_strdup_printf("virtio%d", i);;
+        char *name = g_strdup_printf("virtio%d", i);
         hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
         int irq = VERSAL_RSVD_IRQ_FIRST + i;
         MemoryRegion *mr;
Signature · 1 line
2.21.1
#19 lore raw

PATCH RESEND 6/13 hw/m68k/next-cube: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 956a78118bf
---
 hw/m68k/next-cube.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/m68k/next-cube.c +1 -1
index e5343348d0..350c6fec78 100644
@@ -734,7 +734,7 @@ void next_irq(void *opaque, int number, int level)
     switch (number) {
     /* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */
     case NEXT_FD_I:
-        shift = 7;;
+        shift = 7;
         break;
     case NEXT_KBD_I:
         shift = 3;
Signature · 1 line
2.21.1
#22 lore raw

PATCH RESEND 7/13 hw/scsi/esp: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 74d71ea16bc

---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Mark Cave-Ayland <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Paolo Bonzini <[email protected]>

---
 hw/scsi/esp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/scsi/esp.c +1 -1
index f8fc30cccb..405f8b7cbc 100644
@@ -293,7 +293,7 @@ static void handle_satn_stop(ESPState *s)
         s->dma_cb = handle_satn_stop;
         return;
     }
-    s->pdma_cb = satn_stop_pdma_cb;;
+    s->pdma_cb = satn_stop_pdma_cb;
     s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
     if (s->cmdlen) {
         trace_esp_handle_satn_stop(s->cmdlen);
Signature · 1 line
2.21.1
#25 lore raw

PATCH RESEND 8/13 hw/vfio/display: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 8b818e059bf

---
Cc: Gerd Hoffmann <[email protected]>

---
 hw/vfio/display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/display.c +1 -1
index a5a608c5b2..f4977c66e1 100644
@@ -287,7 +287,7 @@ static void vfio_display_dmabuf_update(void *opaque)
     VFIOPCIDevice *vdev = opaque;
     VFIODisplay *dpy = vdev->dpy;
     VFIODMABuf *primary, *cursor;
-    bool free_bufs = false, new_cursor = false;;
+    bool free_bufs = false, new_cursor = false;
 
     primary = vfio_display_get_dmabuf(vdev, DRM_PLANE_TYPE_PRIMARY);
     if (primary == NULL) {
Signature · 1 line
2.21.1
#32 lore raw

PATCH RESEND 10/13 ui/input-barrier: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 6105683da35

---
Cc: Laurent Vivier <[email protected]>

---
 ui/input-barrier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/input-barrier.c +1 -1
index fe35049b83..527c75e130 100644
@@ -455,7 +455,7 @@ static gboolean writecmd(InputBarrier *ib, struct barrierMsg *msg)
         break;
     default:
         write_cmd(p, barrierCmdEUnknown, avail);
-        break;;
+        break;
     }
 
     len = MAX_HELLO_LENGTH - avail - sizeof(int);
Signature · 1 line
2.21.1
#35 lore raw

PATCH RESEND 11/13 target/i386/whpx: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes 812d49f2a3e

---
Cc: Justin Terry (VM) <[email protected]>

---
 target/i386/whpx-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/whpx-all.c +1 -1
index 3ed2aa1892..35601b8176 100644
@@ -511,7 +511,7 @@ static void whpx_get_registers(CPUState *cpu)
     /* WHvX64RegisterPat - Skipped */
 
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterCs);
-    env->sysenter_cs = vcxt.values[idx++].Reg64;;
+    env->sysenter_cs = vcxt.values[idx++].Reg64;
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterEip);
     env->sysenter_eip = vcxt.values[idx++].Reg64;
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterEsp);
Signature · 1 line
2.21.1
#39 lore raw

PATCH RESEND 12/13 tests/qtest/libqos/qgraph: Remove superfluous semicolons

In reply to Philippe Mathieu-Daudé
Fixes fc281c80202

---
Cc: Emanuele Giuseppe Esposito <[email protected]>

---
 tests/qtest/libqos/qgraph.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qtest/libqos/qgraph.c +2 -2
index 7a7ae2a19e..ca01de0743 100644
@@ -474,7 +474,7 @@ QOSEdgeType qos_graph_edge_get_type(QOSGraphEdge *edge)
     if (!edge) {
         return -1;
     }
-    return edge->type;;
+    return edge->type;
 }
 
 char *qos_graph_edge_get_dest(QOSGraphEdge *edge)
@@ -590,7 +590,7 @@ void qos_add_test(const char *name, const char *interface,
                   QOSTestFunc test_func, QOSGraphTestOptions *opts)
 {
     QOSGraphNode *node;
-    char *test_name = g_strdup_printf("%s-tests/%s", interface, name);;
+    char *test_name = g_strdup_printf("%s-tests/%s", interface, name);
     QOSGraphTestOptions def_opts = { };
 
     if (!opts) {
Signature · 1 line
2.21.1
#42 lore raw

PATCH RESEND 13/13 contrib/rdmacm-mux: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes a5d2f6f8773

---
Cc: Shamir Rabinovitch <[email protected]>

---
 contrib/rdmacm-mux/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/rdmacm-mux/main.c +1 -1
index de53048f06..bd82abbad3 100644
@@ -490,7 +490,7 @@ static int read_and_process(int fd)
 
 static int accept_all(void)
 {
-    int fd, rc = 0;;
+    int fd, rc = 0;
 
     pthread_rwlock_wrlock(&server.lock);
 
Signature · 1 line
2.21.1
#28 lore raw

PATCH RESEND 9/13 migration/multifd: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Fixes d32ca5ad798
---
 migration/multifd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/multifd.c +1 -1
index b3e8ae9bcc..cfaba1369e 100644
@@ -305,7 +305,7 @@ static int multifd_send_pages(QEMUFile *f)
                 + p->packet_len;
     qemu_file_update_transfer(f, transferred);
     ram_counters.multifd_bytes += transferred;
-    ram_counters.transferred += transferred;;
+    ram_counters.transferred += transferred;
     qemu_mutex_unlock(&p->mutex);
     qemu_sem_post(&p->sem);
 
Signature · 1 line
2.21.1
Reviewed-by on v1 1/13
#2 lore raw

Re: [PATCH RESEND 01/13] scripts/checkpatch.pl: Detect superfluous semicolon in C code

In reply to Philippe Mathieu-Daudé
Quoted 10 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:

Display error when a commit contains superfluous semicolon:

  $ git show 6663a0a3376 | scripts/checkpatch.pl -q -
  ERROR: superfluous trailing semicolon
  #276: FILE: block/io_uring.c:186:
  +                ret = -ENOSPC;;
  total: 1 errors, 1 warnings, 485 lines checked
Quoted 25 lines

---
Cc: Paolo Bonzini <[email protected]>

---
 scripts/checkpatch.pl | 5 +++++
 1 file changed, 5 insertions(+)
scripts/checkpatch.pl +5 -0
index ce43a306f8..11512a8a09 100755
@@ -1830,6 +1830,11 @@ sub process {
 			ERROR("suspicious ; after while (0)\n" . $herecurr);
 		}
 
+# Check superfluous trailing ';'
+		if ($line =~ /;;$/) {
+			ERROR("superfluous trailing semicolon\n" . $herecurr);
+		}
+
 # Check relative indent for conditionals and blocks.
 		if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
 			my ($s, $c) = ($stat, $cond);
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 2/13
#6 lore raw

Re: [PATCH RESEND 02/13] audio/alsaaudio: Remove superfluous semicolons

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 286a5d201e4
Quoted 31 lines

---
Cc: "Kővágó, Zoltán" <[email protected]>

---
 audio/alsaaudio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
audio/alsaaudio.c +2 -2
index a23a5a0b60..a8e62542f9 100644
@@ -819,7 +819,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
             switch (nread) {
             case 0:
                 trace_alsa_read_zero(len);
-                return pos;;
+                return pos;
 
             case -EPIPE:
                 if (alsa_recover(alsa->handle)) {
@@ -835,7 +835,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
             default:
                 alsa_logerr(nread, "Failed to read %zu frames to %p\n",
                             len, dst);
-                return pos;;
+                return pos;
             }
         }
 
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 3/13
#9 lore raw

Re: [PATCH RESEND 03/13] block: Remove superfluous semicolons

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 132ada80c4a
Quoted 27 lines
---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block.c +2 -2
index 9c810534d6..9db0b973fe 100644
@@ -2435,13 +2435,13 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,
     if (bdrv_get_aio_context(child_bs) != ctx) {
         ret = bdrv_try_set_aio_context(child_bs, ctx, &local_err);
         if (ret < 0 && child_role->can_set_aio_ctx) {
-            GSList *ignore = g_slist_prepend(NULL, child);;
+            GSList *ignore = g_slist_prepend(NULL, child);
             ctx = bdrv_get_aio_context(child_bs);
             if (child_role->can_set_aio_ctx(child, ctx, &ignore, NULL)) {
                 error_free(local_err);
                 ret = 0;
                 g_slist_free(ignore);
-                ignore = g_slist_prepend(NULL, child);;
+                ignore = g_slist_prepend(NULL, child);
                 child_role->set_aio_ctx(child, ctx, &ignore);
             }
             g_slist_free(ignore);
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 4/13
#12 lore raw

Re: [PATCH RESEND 04/13] block/io_uring: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 4 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 6663a0a3376

---
Cc: Stefano Garzarella <[email protected]>

Quoted 20 lines
---
 block/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/io_uring.c +1 -1
index 56892fd1ab..a3142ca989 100644
@@ -187,7 +187,7 @@ static void luring_process_completions(LuringState *s)
                     ret = 0;
                 }
             } else {
-                ret = -ENOSPC;;
+                ret = -ENOSPC;
             }
         }
 end:
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 5/13
#17 lore raw

Re: [PATCH RESEND 05/13] hw/arm/xlnx-versal: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 6f16da53ffe
Quoted 20 lines
---
 hw/arm/xlnx-versal-virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/xlnx-versal-virt.c +1 -1
index 462493c467..0d2e3bdda1 100644
@@ -350,7 +350,7 @@ static void create_virtio_regions(VersalVirt *s)
     int i;
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
-        char *name = g_strdup_printf("virtio%d", i);;
+        char *name = g_strdup_printf("virtio%d", i);
         hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
         int irq = VERSAL_RSVD_IRQ_FIRST + i;
         MemoryRegion *mr;
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 4/13
#13 lore raw

Re: [PATCH RESEND 04/13] block/io_uring: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 7 lines · Philippe Mathieu-Daudé
Fixes 6663a0a3376

---
Cc: Stefano Garzarella <[email protected]>

---
 block/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Stefano

Quoted 17 lines
block/io_uring.c +1 -1
index 56892fd1ab..a3142ca989 100644
@@ -187,7 +187,7 @@ static void luring_process_completions(LuringState *s)
                     ret = 0;
                 }
             } else {
-                ret = -ENOSPC;;
+                ret = -ENOSPC;
             }
         }
 end:
Signature · 1 line
2.21.1
Reviewed-by on v1 6/13
#20 lore raw

Re: [PATCH RESEND 06/13] hw/m68k/next-cube: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 956a78118bf
Quoted 20 lines
---
 hw/m68k/next-cube.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/m68k/next-cube.c +1 -1
index e5343348d0..350c6fec78 100644
@@ -734,7 +734,7 @@ void next_irq(void *opaque, int number, int level)
     switch (number) {
     /* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */
     case NEXT_FD_I:
-        shift = 7;;
+        shift = 7;
         break;
     case NEXT_KBD_I:
         shift = 3;
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 7/13
#23 lore raw

Re: [PATCH RESEND 07/13] hw/scsi/esp: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 74d71ea16bc
Quoted 25 lines

---
Cc: Dr. David Alan Gilbert <[email protected]>
Cc: Mark Cave-Ayland <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Paolo Bonzini <[email protected]>

---
 hw/scsi/esp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/scsi/esp.c +1 -1
index f8fc30cccb..405f8b7cbc 100644
@@ -293,7 +293,7 @@ static void handle_satn_stop(ESPState *s)
         s->dma_cb = handle_satn_stop;
         return;
     }
-    s->pdma_cb = satn_stop_pdma_cb;;
+    s->pdma_cb = satn_stop_pdma_cb;
     s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
     if (s->cmdlen) {
         trace_esp_handle_satn_stop(s->cmdlen);
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 8/13
#26 lore raw

Re: [PATCH RESEND 08/13] hw/vfio/display: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 8b818e059bf
Quoted 22 lines

---
Cc: Gerd Hoffmann <[email protected]>

---
 hw/vfio/display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/display.c +1 -1
index a5a608c5b2..f4977c66e1 100644
@@ -287,7 +287,7 @@ static void vfio_display_dmabuf_update(void *opaque)
     VFIOPCIDevice *vdev = opaque;
     VFIODisplay *dpy = vdev->dpy;
     VFIODMABuf *primary, *cursor;
-    bool free_bufs = false, new_cursor = false;;
+    bool free_bufs = false, new_cursor = false;
 
     primary = vfio_display_get_dmabuf(vdev, DRM_PLANE_TYPE_PRIMARY);
     if (primary == NULL) {
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 9/13
#29 lore raw

Re: [PATCH RESEND 09/13] migration/multifd: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes d32ca5ad798
Quoted 20 lines
---
 migration/multifd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/multifd.c +1 -1
index b3e8ae9bcc..cfaba1369e 100644
@@ -305,7 +305,7 @@ static int multifd_send_pages(QEMUFile *f)
                 + p->packet_len;
     qemu_file_update_transfer(f, transferred);
     ram_counters.multifd_bytes += transferred;
-    ram_counters.transferred += transferred;;
+    ram_counters.transferred += transferred;
     qemu_mutex_unlock(&p->mutex);
     qemu_sem_post(&p->sem);
 
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 10/13
#33 lore raw

Re: [PATCH RESEND 10/13] ui/input-barrier: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 4 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 6105683da35

---
Cc: Laurent Vivier <[email protected]>

Quoted 20 lines
---
 ui/input-barrier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ui/input-barrier.c +1 -1
index fe35049b83..527c75e130 100644
@@ -455,7 +455,7 @@ static gboolean writecmd(InputBarrier *ib, struct barrierMsg *msg)
         break;
     default:
         write_cmd(p, barrierCmdEUnknown, avail);
-        break;;
+        break;
     }
 
     len = MAX_HELLO_LENGTH - avail - sizeof(int);
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 11/13
#36 lore raw

Re: [PATCH RESEND 11/13] target/i386/whpx: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 812d49f2a3e
Quoted 22 lines

---
Cc: Justin Terry (VM) <[email protected]>

---
 target/i386/whpx-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/whpx-all.c +1 -1
index 3ed2aa1892..35601b8176 100644
@@ -511,7 +511,7 @@ static void whpx_get_registers(CPUState *cpu)
     /* WHvX64RegisterPat - Skipped */
 
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterCs);
-    env->sysenter_cs = vcxt.values[idx++].Reg64;;
+    env->sysenter_cs = vcxt.values[idx++].Reg64;
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterEip);
     env->sysenter_eip = vcxt.values[idx++].Reg64;
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterEsp);
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 12/13
#40 lore raw

Re: [PATCH RESEND 12/13] tests/qtest/libqos/qgraph: Remove superfluous semicolons

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes fc281c80202
Quoted 31 lines

---
Cc: Emanuele Giuseppe Esposito <[email protected]>

---
 tests/qtest/libqos/qgraph.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qtest/libqos/qgraph.c +2 -2
index 7a7ae2a19e..ca01de0743 100644
@@ -474,7 +474,7 @@ QOSEdgeType qos_graph_edge_get_type(QOSGraphEdge *edge)
     if (!edge) {
         return -1;
     }
-    return edge->type;;
+    return edge->type;
 }
 
 char *qos_graph_edge_get_dest(QOSGraphEdge *edge)
@@ -590,7 +590,7 @@ void qos_add_test(const char *name, const char *interface,
                   QOSTestFunc test_func, QOSGraphTestOptions *opts)
 {
     QOSGraphNode *node;
-    char *test_name = g_strdup_printf("%s-tests/%s", interface, name);;
+    char *test_name = g_strdup_printf("%s-tests/%s", interface, name);
     QOSGraphTestOptions def_opts = { };
 
     if (!opts) {
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 13/13
#43 lore raw

Re: [PATCH RESEND 13/13] contrib/rdmacm-mux: Remove superfluous semicolon

In reply to Philippe Mathieu-Daudé
Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes a5d2f6f8773
Quoted 22 lines

---
Cc: Shamir Rabinovitch <[email protected]>

---
 contrib/rdmacm-mux/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/rdmacm-mux/main.c +1 -1
index de53048f06..bd82abbad3 100644
@@ -490,7 +490,7 @@ static int read_and_process(int fd)
 
 static int accept_all(void)
 {
-    int fd, rc = 0;;
+    int fd, rc = 0;
 
     pthread_rwlock_wrlock(&server.lock);
 
Signature · 1 line
2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/13
#3 lore raw

Re: [PATCH RESEND 01/13] scripts/checkpatch.pl: Detect superfluous semicolon in C code

In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

Display error when a commit contains superfluous semicolon:

  $ git show 6663a0a3376 | scripts/checkpatch.pl -q -
  ERROR: superfluous trailing semicolon
  #276: FILE: block/io_uring.c:186:
  +                ret = -ENOSPC;;
  total: 1 errors, 1 warnings, 485 lines checked
Reviewed-by on v1 1/13
#4 lore raw

Re: [PATCH RESEND 01/13] scripts/checkpatch.pl: Detect superfluous semicolon in C code

In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

Display error when a commit contains superfluous semicolon:

  $ git show 6663a0a3376 | scripts/checkpatch.pl -q -
  ERROR: superfluous trailing semicolon
  #276: FILE: block/io_uring.c:186:
  +                ret = -ENOSPC;;
  total: 1 errors, 1 warnings, 485 lines checked
Quoted 23 lines

---
Cc: Paolo Bonzini <[email protected]>

---
 scripts/checkpatch.pl | 5 +++++
 1 file changed, 5 insertions(+)
scripts/checkpatch.pl +5 -0
index ce43a306f8..11512a8a09 100755
@@ -1830,6 +1830,11 @@ sub process {
 			ERROR("suspicious ; after while (0)\n" . $herecurr);
 		}
 
+# Check superfluous trailing ';'
+		if ($line =~ /;;$/) {
+			ERROR("superfluous trailing semicolon\n" . $herecurr);
+		}
+
 # Check relative indent for conditionals and blocks.
 		if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
 			my ($s, $c) = ($stat, $cond);
Acked-by on the v1 series
#45 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 20 lines · Philippe Mathieu-Daudé

Luc noticed a superfluous trailing semicolon:
https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg04593.html

Prevent that by modifying checkpatch.pl and clean the codebase.

Philippe Mathieu-Daudé (13):
scripts/checkpatch.pl: Detect superfluous semicolon in C code audio/alsaaudio: Remove superfluous semicolons
block: Remove superfluous semicolons block/io_uring: Remove superfluous semicolon hw/arm/xlnx-versal: Remove superfluous semicolon hw/m68k/next-cube: Remove superfluous semicolon hw/scsi/esp: Remove superfluous semicolon hw/vfio/display: Remove superfluous semicolon migration/multifd: Remove superfluous semicolon ui/input-barrier: Remove superfluous semicolon target/i386/whpx: Remove superfluous semicolon tests/qtest/libqos/qgraph: Remove superfluous semicolons contrib/rdmacm-mux: Remove superfluous semicolon

Quoted 15 lines
 audio/alsaaudio.c           | 4 ++--
 block.c                     | 4 ++--
 block/io_uring.c            | 2 +-
 contrib/rdmacm-mux/main.c   | 2 +-
 hw/arm/xlnx-versal-virt.c   | 2 +-
 hw/m68k/next-cube.c         | 2 +-
 hw/scsi/esp.c               | 2 +-
 hw/vfio/display.c           | 2 +-
 migration/multifd.c         | 2 +-
 target/i386/whpx-all.c      | 2 +-
 tests/qtest/libqos/qgraph.c | 4 ++--
 ui/input-barrier.c          | 2 +-
 scripts/checkpatch.pl       | 5 +++++
 13 files changed, 20 insertions(+), 15 deletions(-)

Laurent, can you queue this in qemu-trivial?

#46 lore raw
Quoted 37 lines · Paolo Bonzini
Quoted 20 lines · Philippe Mathieu-Daudé

Luc noticed a superfluous trailing semicolon:
https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg04593.html

Prevent that by modifying checkpatch.pl and clean the codebase.

Philippe Mathieu-Daudé (13):
scripts/checkpatch.pl: Detect superfluous semicolon in C code audio/alsaaudio: Remove superfluous semicolons
block: Remove superfluous semicolons block/io_uring: Remove superfluous semicolon hw/arm/xlnx-versal: Remove superfluous semicolon hw/m68k/next-cube: Remove superfluous semicolon hw/scsi/esp: Remove superfluous semicolon hw/vfio/display: Remove superfluous semicolon migration/multifd: Remove superfluous semicolon ui/input-barrier: Remove superfluous semicolon target/i386/whpx: Remove superfluous semicolon tests/qtest/libqos/qgraph: Remove superfluous semicolons contrib/rdmacm-mux: Remove superfluous semicolon

Quoted 15 lines
 audio/alsaaudio.c           | 4 ++--
 block.c                     | 4 ++--
 block/io_uring.c            | 2 +-
 contrib/rdmacm-mux/main.c   | 2 +-
 hw/arm/xlnx-versal-virt.c   | 2 +-
 hw/m68k/next-cube.c         | 2 +-
 hw/scsi/esp.c               | 2 +-
 hw/vfio/display.c           | 2 +-
 migration/multifd.c         | 2 +-
 target/i386/whpx-all.c      | 2 +-
 tests/qtest/libqos/qgraph.c | 4 ++--
 ui/input-barrier.c          | 2 +-
 scripts/checkpatch.pl       | 5 +++++
 13 files changed, 20 insertions(+), 15 deletions(-)
Quoted 4 lines

Laurent, can you queue this in qemu-trivial?

Yes, I will.

Thanks,
Laurent

#47 lore raw
In reply to Paolo Bonzini

Le 18/02/2020 à 18:04, Paolo Bonzini a écrit :

Quoted 37 lines · Philippe Mathieu-Daudé
Quoted 20 lines

Luc noticed a superfluous trailing semicolon:
https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg04593.html

Prevent that by modifying checkpatch.pl and clean the codebase.

Philippe Mathieu-Daudé (13):
scripts/checkpatch.pl: Detect superfluous semicolon in C code audio/alsaaudio: Remove superfluous semicolons
block: Remove superfluous semicolons block/io_uring: Remove superfluous semicolon hw/arm/xlnx-versal: Remove superfluous semicolon hw/m68k/next-cube: Remove superfluous semicolon hw/scsi/esp: Remove superfluous semicolon hw/vfio/display: Remove superfluous semicolon migration/multifd: Remove superfluous semicolon ui/input-barrier: Remove superfluous semicolon target/i386/whpx: Remove superfluous semicolon tests/qtest/libqos/qgraph: Remove superfluous semicolons contrib/rdmacm-mux: Remove superfluous semicolon

Quoted 15 lines
 audio/alsaaudio.c           | 4 ++--
 block.c                     | 4 ++--
 block/io_uring.c            | 2 +-
 contrib/rdmacm-mux/main.c   | 2 +-
 hw/arm/xlnx-versal-virt.c   | 2 +-
 hw/m68k/next-cube.c         | 2 +-
 hw/scsi/esp.c               | 2 +-
 hw/vfio/display.c           | 2 +-
 migration/multifd.c         | 2 +-
 target/i386/whpx-all.c      | 2 +-
 tests/qtest/libqos/qgraph.c | 4 ++--
 ui/input-barrier.c          | 2 +-
 scripts/checkpatch.pl       | 5 +++++
 13 files changed, 20 insertions(+), 15 deletions(-)
Quoted 4 lines

Laurent, can you queue this in qemu-trivial?

Queued, except patches 3, 4 (taken by Kevin) and 9 (by Juan)

Thanks,
Laurent

Reviewed-by
#37 lore raw

RE: [EXTERNAL] Re: [PATCH RESEND 11/13] target/i386/whpx: Remove superfluous semicolon

In reply to Dr. David Alan Gilbert

+Sunil Muthuswamy <[email protected]>

LGTM. Thanks!

Quoted 53 lines

-----Original Message-----
From: Dr. David Alan Gilbert <[email protected]>
Sent: Tuesday, February 18, 2020 2:00 AM
To: Philippe Mathieu-Daudé <[email protected]>
Cc: [email protected]; Max Reitz <[email protected]>; Kevin Wolf <[email protected]>; Thomas Huth <[email protected]>; Fam Zheng <[email protected]>; Eduardo Habkost <[email protected]>; Alex Williamson <[email protected]>; Marcel Apfelbaum <[email protected]>; Richard Henderson <[email protected]>; Julia Suvorova <[email protected]>; Thomas Huth <[email protected]>; Edgar E. Iglesias <[email protected]>; Aarushi Mehta <[email protected]>; [email protected]; Stefan Hajnoczi <[email protected]>; Alistair Francis <[email protected]>; Gerd Hoffmann <[email protected]>; Luc Michel <[email protected]>; Laurent Vivier <[email protected]>; Juan Quintela <[email protected]>; Michael Tokarev <[email protected]>; Laurent Vivier <[email protected]>; Paolo Bonzini <[email protected]>; Yuval Shaia <[email protected]>; [email protected]; Peter Maydell <[email protected]>; [email protected]; Justin Terry (SF) <[email protected]>
Subject: [EXTERNAL] Re: [PATCH RESEND 11/13] target/i386/whpx: Remove superfluous semicolon

Quoted 2 lines · * Philippe Mathieu-Daudé ([email protected]) wrote:
Fixes 812d49f2a3e
Quoted 20 lines

---
Cc: Justin Terry (VM) <[email protected]>

---
 target/i386/whpx-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/whpx-all.c index renamed from target/i386/whpx-all.c +0 -0

3ed2aa1892..35601b8176 100644

target/i386/whpx-all.c +1 -2
@@ -511,7 +511,7 @@ static void whpx_get_registers(CPUState *cpu)
     /* WHvX64RegisterPat - Skipped */
 
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterCs);
-    env->sysenter_cs = vcxt.values[idx++].Reg64;;
+    env->sysenter_cs = vcxt.values[idx++].Reg64;
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterEip);
     env->sysenter_eip = vcxt.values[idx++].Reg64;
     assert(whpx_register_names[idx] == WHvX64RegisterSysenterEsp);
--
Quoted 2 lines

2.21.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK