qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Jason Wang" <jasowang@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Marek Vasut" <marex@denx.de>,
	qemu-block@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
	qemu-trivial@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>, "Jiri Pirko" <jiri@resnulli.us>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	qemu-arm@nongnu.org, "Richard Henderson" <rth@twiddle.net>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Thomas Huth" <huth@tuxfamily.org>,
	"Chris Wulff" <crwulff@gmail.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Max Reitz" <mreitz@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Luc Michel" <luc.michel@greensocs.com>
Subject: [PULL 03/17] scripts/checkpatch.pl: Detect superfluous semicolon in C code
Date: Wed, 19 Feb 2020 11:15:58 +0100	[thread overview]
Message-ID: <20200219101612.1033925-4-laurent@vivier.eu> (raw)
In-Reply-To: <20200219101612.1033925-1-laurent@vivier.eu>

From: Philippe Mathieu-Daudé <philmd@redhat.com>

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

Reported-by: Luc Michel <luc.michel@greensocs.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Message-Id: <20200218094402.26625-2-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 scripts/checkpatch.pl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ce43a306f867..11512a8a09b8 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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);
-- 
2.24.1



  parent reply	other threads:[~2020-02-19 10:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 10:15 [PULL 00/17] Trivial branch patches Laurent Vivier
2020-02-19 10:15 ` [PULL 01/17] mailmap: Add entry for Yu-Chen Lin Laurent Vivier
2020-02-19 10:15 ` [PULL 02/17] Report stringified errno in VFIO related errors Laurent Vivier
2020-02-19 10:15 ` Laurent Vivier [this message]
2020-02-19 10:15 ` [PULL 04/17] audio/alsaaudio: Remove superfluous semicolons Laurent Vivier
2020-02-19 10:16 ` [PULL 05/17] hw/arm/xlnx-versal: Remove superfluous semicolon Laurent Vivier
2020-02-19 10:16 ` [PULL 06/17] hw/m68k/next-cube: " Laurent Vivier
2020-02-19 10:16 ` [PULL 07/17] hw/scsi/esp: " Laurent Vivier
2020-02-19 10:16 ` [PULL 08/17] hw/vfio/display: " Laurent Vivier
2020-02-19 10:16 ` [PULL 09/17] ui/input-barrier: " Laurent Vivier
2020-02-19 10:16 ` [PULL 10/17] target/i386/whpx: " Laurent Vivier
2020-02-19 10:16 ` [PULL 11/17] tests/qtest/libqos/qgraph: Remove superfluous semicolons Laurent Vivier
2020-02-19 10:16 ` [PULL 12/17] contrib/rdmacm-mux: Remove superfluous semicolon Laurent Vivier
2020-02-19 10:16 ` [PULL 13/17] hw/display/qxl: Remove unneeded variable assignment Laurent Vivier
2020-02-19 10:16 ` [PULL 14/17] hw/block/pflash_cfi02: " Laurent Vivier
2020-02-19 10:16 ` [PULL 15/17] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP) Laurent Vivier
2020-02-19 10:16 ` [PULL 16/17] hw/nios2:fix leak of fdevice tree blob Laurent Vivier
2020-02-19 10:16 ` [PULL 17/17] hw/xtensa/xtfpga:fix " Laurent Vivier
2020-02-20 17:35 ` [PULL 00/17] Trivial branch patches Peter Maydell

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=20200219101612.1033925-4-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alex.williamson@redhat.com \
    --cc=alistair@alistair23.me \
    --cc=crwulff@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=fam@euphon.net \
    --cc=huth@tuxfamily.org \
    --cc=jasowang@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=luc.michel@greensocs.com \
    --cc=lvivier@redhat.com \
    --cc=marex@denx.de \
    --cc=mjt@tls.msk.ru \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    --cc=yuval.shaia.ml@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).