[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/17] scripts/checkpatch.pl: Detect superfluous semicolon in C co
From: |
Laurent Vivier |
Subject: |
[PULL 03/17] scripts/checkpatch.pl: Detect superfluous semicolon in C code |
Date: |
Wed, 19 Feb 2020 11:15:58 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
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 <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Luc Michel <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
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
- [PULL 00/17] Trivial branch patches, Laurent Vivier, 2020/02/19
- [PULL 05/17] hw/arm/xlnx-versal: Remove superfluous semicolon, Laurent Vivier, 2020/02/19
- [PULL 02/17] Report stringified errno in VFIO related errors, Laurent Vivier, 2020/02/19
- [PULL 07/17] hw/scsi/esp: Remove superfluous semicolon, Laurent Vivier, 2020/02/19
- [PULL 03/17] scripts/checkpatch.pl: Detect superfluous semicolon in C code,
Laurent Vivier <=
- [PULL 06/17] hw/m68k/next-cube: Remove superfluous semicolon, Laurent Vivier, 2020/02/19
- [PULL 08/17] hw/vfio/display: Remove superfluous semicolon, Laurent Vivier, 2020/02/19
- [PULL 16/17] hw/nios2:fix leak of fdevice tree blob, Laurent Vivier, 2020/02/19
- [PULL 01/17] mailmap: Add entry for Yu-Chen Lin, Laurent Vivier, 2020/02/19
- [PULL 15/17] hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP), Laurent Vivier, 2020/02/19
- [PULL 10/17] target/i386/whpx: Remove superfluous semicolon, Laurent Vivier, 2020/02/19
- [PULL 17/17] hw/xtensa/xtfpga:fix leak of fdevice tree blob, Laurent Vivier, 2020/02/19
- [PULL 04/17] audio/alsaaudio: Remove superfluous semicolons, Laurent Vivier, 2020/02/19
- [PULL 11/17] tests/qtest/libqos/qgraph: Remove superfluous semicolons, Laurent Vivier, 2020/02/19
- [PULL 13/17] hw/display/qxl: Remove unneeded variable assignment, Laurent Vivier, 2020/02/19