* [PATCH 00/13] trivial: Detect and remove superfluous semicolons in C code
@ 2020-02-18 9:37 Philippe Mathieu-Daudé
2020-02-18 9:37 ` [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon " Philippe Mathieu-Daudé
2020-02-18 9:41 ` [PATCH 00/13] trivial: Detect and remove superfluous semicolons " Philippe Mathieu-Daudé
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-18 9:37 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Michael Tokarev, Yuval Shaia,
Gerd Hoffmann, Edgar E. Iglesias, qemu-block, Juan Quintela,
qemu-trivial, Philippe Mathieu-Daudé,
Laurent Vivier, Thomas Huth, Eduardo Habkost, Alistair Francis,
Julia Suvorova, Dr. David Alan Gilbert, Alex Williamson,
qemu-arm, Stefan Hajnoczi, Aarushi Mehta, Richard Henderson,
Kevin Wolf, Thomas Huth, Laurent Vivier, Max Reitz,
Paolo Bonzini, Luc Michel
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(-)
--
2.21.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon in C code
2020-02-18 9:37 [PATCH 00/13] trivial: Detect and remove superfluous semicolons in C code Philippe Mathieu-Daudé
@ 2020-02-18 9:37 ` Philippe Mathieu-Daudé
2020-02-18 9:41 ` [PATCH 00/13] trivial: Detect and remove superfluous semicolons " Philippe Mathieu-Daudé
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-18 9:37 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Michael Tokarev, Yuval Shaia,
Gerd Hoffmann, Edgar E. Iglesias, qemu-block, Juan Quintela,
qemu-trivial, Philippe Mathieu-Daudé,
Laurent Vivier, Thomas Huth, Eduardo Habkost, Alistair Francis,
Julia Suvorova, Dr. David Alan Gilbert, Alex Williamson,
qemu-arm, Stefan Hajnoczi, Aarushi Mehta, Richard Henderson,
Kevin Wolf, Thomas Huth, Laurent Vivier, Max Reitz,
Paolo Bonzini, Luc Michel
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>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/checkpatch.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ce43a306f8..11512a8a09 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.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 00/13] trivial: Detect and remove superfluous semicolons in C code
2020-02-18 9:37 [PATCH 00/13] trivial: Detect and remove superfluous semicolons in C code Philippe Mathieu-Daudé
2020-02-18 9:37 ` [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon " Philippe Mathieu-Daudé
@ 2020-02-18 9:41 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-18 9:41 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Michael Tokarev, Yuval Shaia,
Gerd Hoffmann, Edgar E. Iglesias, qemu-block, Juan Quintela,
qemu-trivial, Laurent Vivier, Thomas Huth, Eduardo Habkost,
Alistair Francis, Julia Suvorova, Dr. David Alan Gilbert,
Alex Williamson, qemu-arm, Stefan Hajnoczi, Aarushi Mehta,
Richard Henderson, Kevin Wolf, Thomas Huth, Laurent Vivier,
Max Reitz, Paolo Bonzini, Luc Michel
On 2/18/20 10:37 AM, Philippe Mathieu-Daudé wrote:
> 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
Please ignore this incomplete series, git-send-email aborted again:
Sent [PATCH 00/13] trivial: Detect and remove superfluous semicolons in
C code
Sent [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon
in C code
5.5.2 Syntax error. v8sm5146891wrw.2 - gsmtp
Offending recipient is: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> which
probably needs quoting.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon in C code
2020-02-18 9:32 Philippe Mathieu-Daudé
@ 2020-02-18 9:32 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-18 9:32 UTC (permalink / raw)
To: qemu-devel
Cc: Fam Zheng, Peter Maydell, Michael Tokarev, Yuval Shaia,
Gerd Hoffmann, Edgar E. Iglesias, qemu-block, Juan Quintela,
qemu-trivial, Philippe Mathieu-Daudé,
Laurent Vivier, Thomas Huth, Eduardo Habkost, Alistair Francis,
Julia Suvorova, Dr. David Alan Gilbert, Alex Williamson,
qemu-arm, Stefan Hajnoczi, Aarushi Mehta, Richard Henderson,
Kevin Wolf, Thomas Huth, Laurent Vivier, Max Reitz,
Paolo Bonzini, Luc Michel
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>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/checkpatch.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ce43a306f8..11512a8a09 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.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-18 9:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 9:37 [PATCH 00/13] trivial: Detect and remove superfluous semicolons in C code Philippe Mathieu-Daudé
2020-02-18 9:37 ` [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon " Philippe Mathieu-Daudé
2020-02-18 9:41 ` [PATCH 00/13] trivial: Detect and remove superfluous semicolons " Philippe Mathieu-Daudé
-- strict thread matches above, loose matches on Subject: below --
2020-02-18 9:32 Philippe Mathieu-Daudé
2020-02-18 9:32 ` [PATCH 01/13] scripts/checkpatch.pl: Detect superfluous semicolon " Philippe Mathieu-Daudé
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).