diff mbox series

checkpatch: g_test_message does not need a a trailing newline

Message ID 20181121182725.4263-1-pbonzini@redhat.com
State New
Headers show
Series checkpatch: g_test_message does not need a a trailing newline | expand

Commit Message

Paolo Bonzini Nov. 21, 2018, 6:27 p.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Nov. 21, 2018, 6:38 p.m. UTC | #1
On 21/11/18 19:27, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   scripts/checkpatch.pl | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index eccd656c41..d27bc51f8c 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2802,7 +2802,8 @@ sub process {
>   				info_vreport|
>   				error_report|
>   				warn_report|
> -				info_report}x;
> +				info_report|
> +                                g_test_message}x;

This perl file use <tab> here, shouldn't we keep the same style?

>   
>   	if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
>   		ERROR("Error messages should not contain newlines\n" . $herecurr);
> 

$ ./scripts/checkpatch.pl -f tests/ipmi-bt-test.c
ERROR: Error messages should not contain newlines
#408: FILE: tests/ipmi-bt-test.c:408:
+        g_test_message("Skipping test for non-x86\n");
total: 1 errors, 0 warnings, 430 lines checked

Nice :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Thomas Huth Nov. 22, 2018, 8:14 a.m. UTC | #2
On 2018-11-21 19:38, Philippe Mathieu-Daudé wrote:
> 
> 
> On 21/11/18 19:27, Paolo Bonzini wrote:
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   scripts/checkpatch.pl | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index eccd656c41..d27bc51f8c 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -2802,7 +2802,8 @@ sub process {
>>                   info_vreport|
>>                   error_report|
>>                   warn_report|
>> -                info_report}x;
>> +                info_report|
>> +                                g_test_message}x;
> 
> This perl file use <tab> here, shouldn't we keep the same style?

+1

Apart from that:

Reviewed-by: Thomas Huth <thuth@redhat.com>
Paolo Bonzini Nov. 22, 2018, 1:06 p.m. UTC | #3
On 21/11/18 19:38, Philippe Mathieu-Daudé wrote:
> 
> 
> On 21/11/18 19:27, Paolo Bonzini wrote:
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   scripts/checkpatch.pl | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index eccd656c41..d27bc51f8c 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -2802,7 +2802,8 @@ sub process {
>>                   info_vreport|
>>                   error_report|
>>                   warn_report|
>> -                info_report}x;
>> +                info_report|
>> +                                g_test_message}x;
> 
> This perl file use <tab> here, shouldn't we keep the same style?
> 
>>         if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
>>           ERROR("Error messages should not contain newlines\n" .
>> $herecurr);
>>
> 
> $ ./scripts/checkpatch.pl -f tests/ipmi-bt-test.c
> ERROR: Error messages should not contain newlines
> #408: FILE: tests/ipmi-bt-test.c:408:
> +        g_test_message("Skipping test for non-x86\n");
> total: 1 errors, 0 warnings, 430 lines checked
> 
> Nice :)
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Queued then, thanks. :)

Paolo
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index eccd656c41..d27bc51f8c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2802,7 +2802,8 @@  sub process {
 				info_vreport|
 				error_report|
 				warn_report|
-				info_report}x;
+				info_report|
+                                g_test_message}x;
 
 	if ($rawline =~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) {
 		ERROR("Error messages should not contain newlines\n" . $herecurr);