checkpatch: add target_ulong to typelist
authorCédric Le Goater <clg@fr.ibm.com>
Fri, 1 Apr 2016 09:40:06 +0000 (11:40 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Apr 2016 09:46:52 +0000 (11:46 +0200)
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>
Message-Id: <1459503606-31603-1-git-send-email-clg@fr.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl

index c26f76ed094f6431155cc6f4680f75d5eb8d0a7f..c9554ba644e1398152ccc981a0df2a1868d38dd7 100755 (executable)
@@ -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