qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] checkpatch: add target_ulong to typelist
@ 2016-04-01  9:40 Cédric Le Goater
  2016-04-01  9:50 ` Greg Kurz
  0 siblings, 1 reply; 3+ messages in thread
From: Cédric Le Goater @ 2016-04-01  9:40 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Cédric Le Goater, qemu-devel, Greg Kurz

In some occasions, a patch [1] can start with a hunk containing a
simple type cast. At the time annotate_values() is run, the type is
unknown and the cast type is misinterpreted as a identifier, resulting
in an error if it is followed with a negative value:

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

It seems complex to catch all possible types in a cast expression. So,
as a fallback solution, let's add some common qemu types to the
typeList array.

[1] http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg06741.html

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
 scripts/checkpatch.pl |    1 +
 1 file changed, 1 insertion(+)

Index: qemu-dgibson-for-2.6.git/scripts/checkpatch.pl
===================================================================
--- qemu-dgibson-for-2.6.git.orig/scripts/checkpatch.pl
+++ qemu-dgibson-for-2.6.git/scripts/checkpatch.pl
@@ -212,6 +212,7 @@ our @typeList = (
 	qr{${Ident}_t},
 	qr{${Ident}_handler},
 	qr{${Ident}_handler_fn},
+	qr{target_(?:u)?long},
 );
 
 # This can be modified by sub possible.  Since it can be empty, be careful

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

* Re: [Qemu-devel] [PATCH] checkpatch: add target_ulong to typelist
  2016-04-01  9:40 [Qemu-devel] [PATCH] checkpatch: add target_ulong to typelist Cédric Le Goater
@ 2016-04-01  9:50 ` Greg Kurz
  2016-04-01 10:31   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kurz @ 2016-04-01  9:50 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: Paolo Bonzini, qemu-devel

On Fri,  1 Apr 2016 11:40:06 +0200
Cédric Le Goater <clg@fr.ibm.com> wrote:

> In some occasions, a patch [1] can start with a hunk containing a
> simple type cast. At the time annotate_values() is run, the type is
> unknown and the cast type is misinterpreted as a identifier, resulting
> in an error if it is followed with a negative value:
> 
> 	ERROR: spaces required around that '-' (ctx:WxV)
> 
> It seems complex to catch all possible types in a cast expression. So,
> as a fallback solution, let's add some common qemu types to the
> typeList array.
> 
> [1] http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg06741.html
> 
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> ---

Indeed, with this patch, the checkpatch script stops complaining when it
sees:

+    if (prefix == (target_ulong) -1ULL) {

And I tend to agree with Cedric... unless Paolo has a bright idea of course. :)

Acked-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

>  scripts/checkpatch.pl |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: qemu-dgibson-for-2.6.git/scripts/checkpatch.pl
> ===================================================================
> --- qemu-dgibson-for-2.6.git.orig/scripts/checkpatch.pl
> +++ qemu-dgibson-for-2.6.git/scripts/checkpatch.pl
> @@ -212,6 +212,7 @@ our @typeList = (
>  	qr{${Ident}_t},
>  	qr{${Ident}_handler},
>  	qr{${Ident}_handler_fn},
> +	qr{target_(?:u)?long},
>  );
> 
>  # This can be modified by sub possible.  Since it can be empty, be careful

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

* Re: [Qemu-devel] [PATCH] checkpatch: add target_ulong to typelist
  2016-04-01  9:50 ` Greg Kurz
@ 2016-04-01 10:31   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-04-01 10:31 UTC (permalink / raw)
  To: Greg Kurz, Cédric Le Goater; +Cc: qemu-devel

On 01/04/2016 11:50, Greg Kurz wrote:
> 
> And I tend to agree with Cedric... unless Paolo has a bright idea of course. :)
> 
> Acked-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

Yes, the patch is correct.

Paolo

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

end of thread, other threads:[~2016-04-01 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-01  9:40 [Qemu-devel] [PATCH] checkpatch: add target_ulong to typelist Cédric Le Goater
2016-04-01  9:50 ` Greg Kurz
2016-04-01 10:31   ` 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).