]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
checkpatch: add hwaddr to @typeList
authorGreg Kurz <groug@kaod.org>
Thu, 14 Sep 2017 09:12:07 +0000 (11:12 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Sep 2017 14:20:49 +0000 (16:20 +0200)
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>
Message-Id: <150538015789.8149.10902725348939486674.stgit@bahia.lan>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl

index 28d71b3733c1bc6fd22f6329ed219a71291d1c20..3c0a28e644aa4e09bb6eda519b9643227ed75dcc 100755 (executable)
@@ -263,6 +263,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