diff mbox

[v3,9/9] checkpatch: add virtio_error and virtqueue_error to error funcs

Message ID 20170717081152.17153-10-lprosek@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ladi Prosek July 17, 2017, 8:11 a.m. UTC
Two more error functions that should not contain newlines.

Suggested-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Cornelia Huck July 17, 2017, 12:01 p.m. UTC | #1
On Mon, 17 Jul 2017 10:11:52 +0200
Ladi Prosek <lprosek@redhat.com> wrote:

> Two more error functions that should not contain newlines.
> 
> Suggested-by: Greg Kurz <groug@kaod.org>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---
>  scripts/checkpatch.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Markus Armbruster July 18, 2017, 4:06 p.m. UTC | #2
Ladi Prosek <lprosek@redhat.com> writes:

> Two more error functions that should not contain newlines.
>
> Suggested-by: Greg Kurz <groug@kaod.org>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---
>  scripts/checkpatch.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4e91122..2cd2713 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2540,7 +2540,9 @@ sub process {
>  				info_vreport|
>  				error_report|
>  				warn_report|
> -				info_report}x;
> +				info_report|
> +				virtio_error|
> +				virtqueue_error}x;
>  
>  	if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
>  		ERROR("Error messages should not contain newlines\n" . $herecurr);

What makes the two functions appropriate for this list is this pattern:

    va_start(ap, fmt);
    msg = g_strdup_vprintf(fmt, ap);
    va_end(ap);

    error_report("... %s", ..., msg);

There's a related pattern using error_vreport().

Do we have more instances of these patterns?

Regardless:
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Stefan Hajnoczi July 21, 2017, 3:17 p.m. UTC | #3
On Mon, Jul 17, 2017 at 10:11:52AM +0200, Ladi Prosek wrote:
> Two more error functions that should not contain newlines.
> 
> Suggested-by: Greg Kurz <groug@kaod.org>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---
>  scripts/checkpatch.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Greg Kurz July 24, 2017, 9:36 a.m. UTC | #4
On Mon, 17 Jul 2017 10:11:52 +0200
Ladi Prosek <lprosek@redhat.com> wrote:

> Two more error functions that should not contain newlines.
> 
> Suggested-by: Greg Kurz <groug@kaod.org>
> Signed-off-by: Ladi Prosek <lprosek@redhat.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  scripts/checkpatch.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4e91122..2cd2713 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2540,7 +2540,9 @@ sub process {
>  				info_vreport|
>  				error_report|
>  				warn_report|
> -				info_report}x;
> +				info_report|
> +				virtio_error|
> +				virtqueue_error}x;
>  
>  	if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
>  		ERROR("Error messages should not contain newlines\n" . $herecurr);
diff mbox

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4e91122..2cd2713 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2540,7 +2540,9 @@  sub process {
 				info_vreport|
 				error_report|
 				warn_report|
-				info_report}x;
+				info_report|
+				virtio_error|
+				virtqueue_error}x;
 
 	if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
 		ERROR("Error messages should not contain newlines\n" . $herecurr);