qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList
@ 2017-09-14  9:12 Greg Kurz
  2017-09-14 13:16 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kurz @ 2017-09-14  9:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, David Gibson

The script doesn't know about all possible types and learn them as
it parses the code. If it reaches a line with a type cast but the
type isn't known yet, it is misinterpreted as an identifier.

For example the following line:

    foo = (hwaddr) -1;

results in the following false-positive to be reported:

ERROR: spaces required around that '-' (ctx:VxV)

Let's add this standard QEMU type to the list of pre-known types.

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

checkpatch doesn't have an official maintainer, Cc'ing David in case he
agrees to carry this patch through his ppc tree, along with:

https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg03686.html

 scripts/checkpatch.pl |    1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fa478074b88d..def5bc1cc0e1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -213,6 +213,7 @@ our @typeList = (
 	qr{${Ident}_handler},
 	qr{${Ident}_handler_fn},
 	qr{target_(?:u)?long},
+	qr{hwaddr},
 );
 
 # This can be modified by sub possible.  Since it can be empty, be careful

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

* Re: [Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList
  2017-09-14  9:12 [Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList Greg Kurz
@ 2017-09-14 13:16 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2017-09-14 13:16 UTC (permalink / raw)
  To: Greg Kurz, qemu-devel; +Cc: David Gibson

On 14/09/2017 11:12, Greg Kurz wrote:
> The script doesn't know about all possible types and learn them as
> it parses the code. If it reaches a line with a type cast but the
> type isn't known yet, it is misinterpreted as an identifier.
> 
> For example the following line:
> 
>     foo = (hwaddr) -1;
> 
> results in the following false-positive to be reported:
> 
> ERROR: spaces required around that '-' (ctx:VxV)
> 
> Let's add this standard QEMU type to the list of pre-known types.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> 
> checkpatch doesn't have an official maintainer, Cc'ing David in case he
> agrees to carry this patch through his ppc tree, along with:
> 
> https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg03686.html
> 
>  scripts/checkpatch.pl |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index fa478074b88d..def5bc1cc0e1 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -213,6 +213,7 @@ our @typeList = (
>  	qr{${Ident}_handler},
>  	qr{${Ident}_handler_fn},
>  	qr{target_(?:u)?long},
> +	qr{hwaddr},
>  );
>  
>  # This can be modified by sub possible.  Since it can be empty, be careful
> 

Queued, thanks.

Paolo

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

end of thread, other threads:[~2017-09-15  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14  9:12 [Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList Greg Kurz
2017-09-14 13:16 ` Paolo Bonzini

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