mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
scripts/checkpatch.pl: Detect superfluous semicolon in C code
Display error when a commit contains superfluous semicolon:
$ git show 6663a0a337 | 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 <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Reviewed-by: Luc Michel <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
This commit is contained in:
1 parent
b09d51c909
commit
ee0f3c09e0
1 file changed
+5
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user