qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL for-2.7 2/4] checkpatch: Fix newline detection in err


From: Markus Armbruster
Subject: [Qemu-devel] [PULL for-2.7 2/4] checkpatch: Fix newline detection in error_setg() & friends
Date: Mon, 8 Aug 2016 09:19:19 +0200

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 <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
 scripts/checkpatch.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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);
        }
 
-- 
2.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]