scripts/checkpatch.pl: fix various indentation mistakes

Various checks in the code were under-indented relative to other
surrounding code. Some places used 4-space indents instead of
single tab, while other places simply used too few tabs.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2025-05-12 18:11:58 +01:00
parent 66411ab48b
commit 619bf37594

View file

@ -1691,8 +1691,9 @@ sub process {
); );
unless (grep { /^$tag$/ } @permitted) { unless (grep { /^$tag$/ } @permitted) {
ERROR("Tag $tag not permitted in QEMU code, valid " . ERROR("Tag $tag not permitted in QEMU code, " .
"choices are: " . join(", ", @permitted)); "valid choices are: " .
join(", ", @permitted));
} }
} }
@ -3139,8 +3140,9 @@ sub process {
ERROR("Error messages should not contain newlines\n" . $herecurr); ERROR("Error messages should not contain newlines\n" . $herecurr);
} }
# Continue checking for error messages that contains newlines. This # Continue checking for error messages that contains newlines.
# check handles cases where string literals are spread over multiple lines. # This check handles cases where string literals are spread
# over multiple lines.
# Example: # Example:
# error_report("Error msg line #1" # error_report("Error msg line #1"
# "Error msg line #2\n"); # "Error msg line #2\n");
@ -3148,8 +3150,9 @@ sub process {
my $continued_str_literal = qr{\+\s*\".*\"}; my $continued_str_literal = qr{\+\s*\".*\"};
if ($rawline =~ /$quoted_newline_regex/) { if ($rawline =~ /$quoted_newline_regex/) {
# Backtrack to first line that does not contain only a quoted literal # Backtrack to first line that does not contain only
# and assume that it is the start of the statement. # a quoted literal and assume that it is the start
# of the statement.
my $i = $linenr - 2; my $i = $linenr - 2;
while (($i >= 0) & $rawlines[$i] =~ /$continued_str_literal/) { while (($i >= 0) & $rawlines[$i] =~ /$continued_str_literal/) {