qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/4] checkpatch: Fix newline detection in error_setg() & friends
Date: Wed,  3 Aug 2016 13:37:52 +0200	[thread overview]
Message-ID: <1470224274-31522-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1470224274-31522-1-git-send-email-armbru@redhat.com>

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>
---
 scripts/checkpatch.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index afa7f79..c2ca999 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

  parent reply	other threads:[~2016-08-03 11:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03 11:37 [Qemu-devel] [PATCH 0/4] error: Newline fixes Markus Armbruster
2016-08-03 11:37 ` [Qemu-devel] [PATCH 1/4] error: Strip trailing '\n' from error string arguments (again) Markus Armbruster
2016-08-04 20:47   ` Eric Blake
2016-08-05  6:57     ` Markus Armbruster
2016-08-03 11:37 ` Markus Armbruster [this message]
2016-08-04 20:49   ` [Qemu-devel] [PATCH 2/4] checkpatch: Fix newline detection in error_setg() & friends Eric Blake
2016-08-03 11:37 ` [Qemu-devel] [PATCH 3/4] vfio: Use error_report() instead of error_printf() for errors Markus Armbruster
2016-08-04 20:51   ` Eric Blake
2016-08-03 11:37 ` [Qemu-devel] [PATCH 4/4] error: Fix error_printf() calls lacking newlines Markus Armbruster
2016-08-04 20:52   ` Eric Blake
2016-08-05  6:58     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470224274-31522-3-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).