qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
@ 2019-10-16  1:24 Wei Yang
  2019-10-16 10:25 ` no-reply
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wei Yang @ 2019-10-16  1:24 UTC (permalink / raw)
  To: pbonzini, philmd, thuth, eblake, berrange
  Cc: David Gibson, qemu-devel, Wei Yang

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
CC: David Gibson <david@gibson.dropbear.id.au>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index aa9a354a0e..4b360ed310 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2915,6 +2915,12 @@ sub process {
 		if ($line =~ /\bbzero\(/) {
 			ERROR("use memset() instead of bzero()\n" . $herecurr);
 		}
+		if ($line =~ /getpagesize\(\)/) {
+			ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
+		}
+		if ($line =~ /sysconf\(_SC_PAGESIZE\)/) {
+			ERROR("use qemu_real_host_page_size instead of sysconf(_SC_PAGESIZE)\n" . $herecurr);
+		}
 		my $non_exit_glib_asserts = qr{g_assert_cmpstr|
 						g_assert_cmpint|
 						g_assert_cmpuint|
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
  2019-10-16  1:24 [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE) Wei Yang
@ 2019-10-16 10:25 ` no-reply
  2019-10-16 13:06   ` Wei Yang
  2019-10-16 15:43 ` Richard Henderson
  2019-10-16 18:48 ` Stefan Hajnoczi
  2 siblings, 1 reply; 7+ messages in thread
From: no-reply @ 2019-10-16 10:25 UTC (permalink / raw)
  To: richardw.yang
  Cc: thuth, berrange, qemu-devel, richardw.yang, pbonzini, philmd, david

Patchew URL: https://patchew.org/QEMU/20191016012432.22731-1-richardw.yang@linux.intel.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
Type: series
Message-id: 20191016012432.22731-1-richardw.yang@linux.intel.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
6c3e035 checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)

=== OUTPUT BEGIN ===
ERROR: line over 90 characters
#20: FILE: scripts/checkpatch.pl:2919:
+                       ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);

ERROR: line over 90 characters
#23: FILE: scripts/checkpatch.pl:2922:
+                       ERROR("use qemu_real_host_page_size instead of sysconf(_SC_PAGESIZE)\n" . $herecurr);

total: 2 errors, 0 warnings, 12 lines checked

Commit 6c3e0354a83f (checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20191016012432.22731-1-richardw.yang@linux.intel.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
  2019-10-16 10:25 ` no-reply
@ 2019-10-16 13:06   ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2019-10-16 13:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, berrange, richardw.yang, pbonzini, philmd, david

On Wed, Oct 16, 2019 at 03:25:53AM -0700, no-reply@patchew.org wrote:
>Patchew URL: https://patchew.org/QEMU/20191016012432.22731-1-richardw.yang@linux.intel.com/
>
>
>
>Hi,
>
>This series seems to have some coding style problems. See output below for
>more information:
>
>Subject: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
>Type: series
>Message-id: 20191016012432.22731-1-richardw.yang@linux.intel.com
>
>=== TEST SCRIPT BEGIN ===
>#!/bin/bash
>git rev-parse base > /dev/null || exit 0
>git config --local diff.renamelimit 0
>git config --local diff.renames True
>git config --local diff.algorithm histogram
>./scripts/checkpatch.pl --mailback base..
>=== TEST SCRIPT END ===
>
>Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
>Switched to a new branch 'test'
>6c3e035 checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
>
>=== OUTPUT BEGIN ===
>ERROR: line over 90 characters
>#20: FILE: scripts/checkpatch.pl:2919:
>+                       ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
>

Since this is an error message and I see other similar code keep it in the
same line, I didn't split it into two lines.

If necessary, I would split it.


-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
  2019-10-16  1:24 [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE) Wei Yang
  2019-10-16 10:25 ` no-reply
@ 2019-10-16 15:43 ` Richard Henderson
  2019-10-17  0:42   ` Wei Yang
  2019-10-16 18:48 ` Stefan Hajnoczi
  2 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2019-10-16 15:43 UTC (permalink / raw)
  To: Wei Yang, pbonzini, philmd, thuth, eblake, berrange
  Cc: qemu-devel, David Gibson

On 10/15/19 6:24 PM, Wei Yang wrote:
>  		if ($line =~ /\bbzero\(/) {
>  			ERROR("use memset() instead of bzero()\n" . $herecurr);
>  		}
> +		if ($line =~ /getpagesize\(\)/) {
> +			ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
> +		}
> +		if ($line =~ /sysconf\(_SC_PAGESIZE\)/) {

Use \b to match beginning of symbol like bzero did?


r~


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
  2019-10-16  1:24 [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE) Wei Yang
  2019-10-16 10:25 ` no-reply
  2019-10-16 15:43 ` Richard Henderson
@ 2019-10-16 18:48 ` Stefan Hajnoczi
  2019-10-17  0:43   ` Wei Yang
  2 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2019-10-16 18:48 UTC (permalink / raw)
  To: Wei Yang; +Cc: thuth, berrange, qemu-devel, pbonzini, philmd, David Gibson

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

On Wed, Oct 16, 2019 at 09:24:32AM +0800, Wei Yang wrote:
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> CC: David Gibson <david@gibson.dropbear.id.au>
> ---
>  scripts/checkpatch.pl | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index aa9a354a0e..4b360ed310 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2915,6 +2915,12 @@ sub process {
>  		if ($line =~ /\bbzero\(/) {
>  			ERROR("use memset() instead of bzero()\n" . $herecurr);
>  		}
> +		if ($line =~ /getpagesize\(\)/) {
> +			ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
> +		}
> +		if ($line =~ /sysconf\(_SC_PAGESIZE\)/) {
> +			ERROR("use qemu_real_host_page_size instead of sysconf(_SC_PAGESIZE)\n" . $herecurr);
> +		}
>  		my $non_exit_glib_asserts = qr{g_assert_cmpstr|
>  						g_assert_cmpint|
>  						g_assert_cmpuint|

Just wanted to say thank you for extending checkpatch.pl!  We don't do
it enough but it's the best way to extend QEMU coding style because it's
automated :).

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
  2019-10-16 15:43 ` Richard Henderson
@ 2019-10-17  0:42   ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2019-10-17  0:42 UTC (permalink / raw)
  To: Richard Henderson
  Cc: thuth, berrange, qemu-devel, Wei Yang, pbonzini, philmd, David Gibson

On Wed, Oct 16, 2019 at 08:43:32AM -0700, Richard Henderson wrote:
>On 10/15/19 6:24 PM, Wei Yang wrote:
>>  		if ($line =~ /\bbzero\(/) {
>>  			ERROR("use memset() instead of bzero()\n" . $herecurr);
>>  		}
>> +		if ($line =~ /getpagesize\(\)/) {
>> +			ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
>> +		}
>> +		if ($line =~ /sysconf\(_SC_PAGESIZE\)/) {
>
>Use \b to match beginning of symbol like bzero did?
>

You are right, thanks for the suggestion.

>
>r~

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE)
  2019-10-16 18:48 ` Stefan Hajnoczi
@ 2019-10-17  0:43   ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2019-10-17  0:43 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: thuth, berrange, qemu-devel, Wei Yang, pbonzini, philmd, David Gibson

On Wed, Oct 16, 2019 at 07:48:50PM +0100, Stefan Hajnoczi wrote:
>On Wed, Oct 16, 2019 at 09:24:32AM +0800, Wei Yang wrote:
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> CC: David Gibson <david@gibson.dropbear.id.au>
>> ---
>>  scripts/checkpatch.pl | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index aa9a354a0e..4b360ed310 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -2915,6 +2915,12 @@ sub process {
>>  		if ($line =~ /\bbzero\(/) {
>>  			ERROR("use memset() instead of bzero()\n" . $herecurr);
>>  		}
>> +		if ($line =~ /getpagesize\(\)/) {
>> +			ERROR("use qemu_real_host_page_size instead of getpagesize()\n" . $herecurr);
>> +		}
>> +		if ($line =~ /sysconf\(_SC_PAGESIZE\)/) {
>> +			ERROR("use qemu_real_host_page_size instead of sysconf(_SC_PAGESIZE)\n" . $herecurr);
>> +		}
>>  		my $non_exit_glib_asserts = qr{g_assert_cmpstr|
>>  						g_assert_cmpint|
>>  						g_assert_cmpuint|
>
>Just wanted to say thank you for extending checkpatch.pl!  We don't do
>it enough but it's the best way to extend QEMU coding style because it's
>automated :).
>

You are welcome. Glad to do something.

>Stefan



-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-17  0:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  1:24 [PATCH] checkpatch: sugguest to use qemu_real_host_page_size instead of getpagesize() or sysconf(_SC_PAGESIZE) Wei Yang
2019-10-16 10:25 ` no-reply
2019-10-16 13:06   ` Wei Yang
2019-10-16 15:43 ` Richard Henderson
2019-10-17  0:42   ` Wei Yang
2019-10-16 18:48 ` Stefan Hajnoczi
2019-10-17  0:43   ` Wei Yang

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).