Skip to content

Commit

Permalink
checkpatch: add hwaddr to @typeList
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gkurz authored and bonzini committed Sep 19, 2017
1 parent 4c44a00 commit 825bfa0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/checkpatch.pl
Expand Up @@ -263,6 +263,7 @@ sub help {
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
Expand Down

0 comments on commit 825bfa0

Please sign in to comment.