diff options
author | Paolo Bonzini | 2018-12-06 12:01:40 +0100 |
---|---|---|
committer | Paolo Bonzini | 2019-01-11 15:46:55 +0100 |
commit | 50db69a15f941628e647076878ad70d0bbd26cf3 (patch) | |
tree | 47340f6aa82fbe5fb0983d098d4875b5d35aad27 | |
parent | qemu/queue.h: simplify reverse access to QTAILQ (diff) | |
download | qemu-50db69a15f941628e647076878ad70d0bbd26cf3.tar.gz qemu-50db69a15f941628e647076878ad70d0bbd26cf3.tar.xz qemu-50db69a15f941628e647076878ad70d0bbd26cf3.zip |
checkpatch: warn about qemu/queue.h head structs that are not typedef-ed
These are just like any other struct or union, so they should have
CamelCase typedefs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3d1ba9e8ae..d10dddf1be 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2310,6 +2310,11 @@ sub process { } } + if ($line =~ /^.\s*(Q(?:S?LIST|SIMPLEQ|TAILQ)_HEAD)\s*\(\s*[^,]/ && + $line !~ /^.typedef/) { + ERROR("named $1 should be typedefed separately\n" . $herecurr); + } + # Need a space before open parenthesis after if, while etc if ($line=~/\b(if|while|for|switch)\(/) { ERROR("space required before the open parenthesis '('\n" . $herecurr); |