diff options
author | Markus Armbruster <armbru@redhat.com> | 2016-08-03 13:37:52 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2016-08-08 09:01:08 +0200 |
commit | a47eb010983b98d41330878f8b3e3193da40e6ed (patch) | |
tree | 216428b5e131e5a081f4bd44c0420db36ab25f71 /scripts/checkpatch.pl | |
parent | df3c286c53ac51e7267f2761c7a0c62e11b6e815 (diff) | |
download | qemu-a47eb010983b98d41330878f8b3e3193da40e6ed.zip qemu-a47eb010983b98d41330878f8b3e3193da40e6ed.tar.gz qemu-a47eb010983b98d41330878f8b3e3193da40e6ed.tar.bz2 |
checkpatch: Fix newline detection in error_setg() & friends
Commit 5d596c2's regexp assumes the error message string is the first
argument. Correct for error_report(), wrong for all the others.
Relax the regexp to match newline in anywhere. This might cause
additional false positives.
While there, update the list of error_reporting functions.
Cc: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1470224274-31522-3-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b7cb4ab..9297087 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2514,11 +2514,14 @@ sub process { my $qemu_error_funcs = qr{error_setg| error_setg_errno| error_setg_win32| + error_setg_file_open| error_set| + error_prepend| + error_reportf_err| error_vreport| error_report}x; - if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(\s*\".*\\n/) { + if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) { WARN("Error messages should not contain newlines\n" . $herecurr); } |