Commit c20b1396 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

checkpatch: do not warn for multiline parenthesized returned value



While indeed we do not want to have

    return (a);

it is less clear that this applies to

    return (a &&
            b);

Some editors indent more nicely if you have parentheses, and some people's
eyes may appreciate that as well.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <1561116534-21814-1-git-send-email-pbonzini@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 58164eaf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2296,7 +2296,8 @@ sub process {
			       $value =~ s/\([^\(\)]*\)/1/) {
			}
#print "value<$value>\n";
			if ($value =~ /^\s*(?:$Ident|-?$Constant)\s*$/) {
			if ($value =~ /^\s*(?:$Ident|-?$Constant)\s*$/ &&
			    $line =~ /;$/) {
				ERROR("return is not a function, parentheses are not required\n" . $herecurr);

			} elsif ($spacing !~ /\s+/) {