diff mbox

[RFC,02/10] maint: remove double semicolons in many files

Message ID 1438360263-25445-3-git-send-email-berrange@redhat.com
State New
Headers show

Commit Message

Daniel P. Berrangé July 31, 2015, 4:30 p.m. UTC
A number of source files have statements accidentally
terminated by a double semicolon - eg 'foo = bar;;'.
This is harmless but a mistake none the less.

The tcg/ia64/tcg-target.c file is whitelisted because
it has valid use of ';;' in a comment containing assembly
code.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 block/vhdx.c         | 2 +-
 cfg.mk               | 5 ++++-
 hw/arm/vexpress.c    | 4 ++--
 hw/intc/arm_gic.c    | 2 +-
 numa.c               | 2 +-
 qga/commands-win32.c | 2 +-
 6 files changed, 10 insertions(+), 7 deletions(-)

Comments

Peter Maydell Aug. 13, 2015, 5:57 p.m. UTC | #1
On 31 July 2015 at 17:30, Daniel P. Berrange <berrange@redhat.com> wrote:
> A number of source files have statements accidentally
> terminated by a double semicolon - eg 'foo = bar;;'.
> This is harmless but a mistake none the less.
>
> The tcg/ia64/tcg-target.c file is whitelisted because
> it has valid use of ';;' in a comment containing assembly
> code.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  block/vhdx.c         | 2 +-
>  cfg.mk               | 5 ++++-
>  hw/arm/vexpress.c    | 4 ++--
>  hw/intc/arm_gic.c    | 2 +-
>  numa.c               | 2 +-
>  qga/commands-win32.c | 2 +-
>  6 files changed, 10 insertions(+), 7 deletions(-)

If you kept the "enable the check in cfg.mk" change out of
the patches like these, we could review and commit them
without them being tangled up or waiting on the review of
the syntax-checking infrastructure itself...

thanks
-- PMM
Daniel P. Berrangé Aug. 14, 2015, 8:32 a.m. UTC | #2
On Thu, Aug 13, 2015 at 06:57:55PM +0100, Peter Maydell wrote:
> On 31 July 2015 at 17:30, Daniel P. Berrange <berrange@redhat.com> wrote:
> > A number of source files have statements accidentally
> > terminated by a double semicolon - eg 'foo = bar;;'.
> > This is harmless but a mistake none the less.
> >
> > The tcg/ia64/tcg-target.c file is whitelisted because
> > it has valid use of ';;' in a comment containing assembly
> > code.
> >
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> >  block/vhdx.c         | 2 +-
> >  cfg.mk               | 5 ++++-
> >  hw/arm/vexpress.c    | 4 ++--
> >  hw/intc/arm_gic.c    | 2 +-
> >  numa.c               | 2 +-
> >  qga/commands-win32.c | 2 +-
> >  6 files changed, 10 insertions(+), 7 deletions(-)
> 
> If you kept the "enable the check in cfg.mk" change out of
> the patches like these, we could review and commit them
> without them being tangled up or waiting on the review of
> the syntax-checking infrastructure itself...

Sure, I just really wanted to illustrate the use of the syntax check
infrastructure with this series of fixes. Now I've done that I'll
resubmit just the fixes, while debate over the checking infrastructure
continues.

Regards,
Daniel
diff mbox

Patch

diff --git a/block/vhdx.c b/block/vhdx.c
index 0776de7..f05c7a9 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1454,7 +1454,7 @@  static int vhdx_create_new_metadata(BlockDriverState *bs,
     uint32_t offset = 0;
     void *buffer = NULL;
     void *entry_buffer;
-    VHDXMetadataTableHeader *md_table;;
+    VHDXMetadataTableHeader *md_table;
     VHDXMetadataTableEntry  *md_table_entry;
 
     /* Metadata entries */
diff --git a/cfg.mk b/cfg.mk
index af5f21f..71a4174 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -53,7 +53,6 @@  local-checks-to-skip =			\
   sc_prohibit_cvs_keyword		\
   sc_prohibit_dirent_without_use 	\
   sc_prohibit_doubled_word		\
-  sc_prohibit_double_semicolon		\
   sc_prohibit_empty_lines_at_EOF 	\
   sc_prohibit_hash_without_use		\
   sc_prohibit_jm_in_m4			\
@@ -137,3 +136,7 @@  sc_copyright_format:
 
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
+
+
+exclude_file_name_regexp--sc_prohibit_double_semicolon = \
+  ^tcg/ia64/tcg-target\.c$
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index da21788..0f8bf1c 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -541,7 +541,7 @@  static void vexpress_common_init(MachineState *machine)
 {
     VexpressMachineState *vms = VEXPRESS_MACHINE(machine);
     VexpressMachineClass *vmc = VEXPRESS_MACHINE_GET_CLASS(machine);
-    VEDBoardInfo *daughterboard = vmc->daughterboard;;
+    VEDBoardInfo *daughterboard = vmc->daughterboard;
     DeviceState *dev, *sysctl, *pl041;
     qemu_irq pic[64];
     uint32_t sys_id;
@@ -762,7 +762,7 @@  static void vexpress_a9_class_init(ObjectClass *oc, void *data)
     mc->name = TYPE_VEXPRESS_A9_MACHINE;
     mc->desc = "ARM Versatile Express for Cortex-A9";
 
-    vmc->daughterboard = &a9_daughterboard;;
+    vmc->daughterboard = &a9_daughterboard;
 }
 
 static void vexpress_a15_class_init(ObjectClass *oc, void *data)
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index 454bfd7..69da6f9 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -239,7 +239,7 @@  uint32_t gic_acknowledge_irq(GICState *s, int cpu, MemTxAttrs attrs)
      * for the case where this GIC supports grouping and the pending interrupt
      * is in the wrong group.
      */
-    irq = gic_get_current_pending_irq(s, cpu, attrs);;
+    irq = gic_get_current_pending_irq(s, cpu, attrs);
 
     if (irq >= GIC_MAXIRQ) {
         DPRINTF("ACK, no pending interrupt or it is hidden: %d\n", irq);
diff --git a/numa.c b/numa.c
index 402804b..eed8f5d 100644
--- a/numa.c
+++ b/numa.c
@@ -280,7 +280,7 @@  static void validate_numa_cpus(void)
             bitmap_and(seen_cpus, seen_cpus,
                        numa_info[i].node_cpu, MAX_CPUMASK_BITS);
             error_report("CPU(s) present in multiple NUMA nodes: %s",
-                         enumerate_cpus(seen_cpus, max_cpus));;
+                         enumerate_cpus(seen_cpus, max_cpus));
             exit(EXIT_FAILURE);
         }
         bitmap_or(seen_cpus, seen_cpus,
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index a7822d5..203664c 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -657,7 +657,7 @@  static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
         fs->mountpoint = g_strndup(mnt_point, len);
     }
     fs->type = g_strdup(fs_name);
-    fs->disk = build_guest_disk_info(guid, errp);;
+    fs->disk = build_guest_disk_info(guid, errp);
 free:
     g_free(mnt_point);
     return fs;