From: Paolo Bonzini Date: Thu, 6 Dec 2018 11:01:40 +0000 (+0100) Subject: checkpatch: warn about qemu/queue.h head structs that are not typedef-ed X-Git-Tag: qemu-xen-4.13.0-rc1~452^2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=50db69a15f941628e647076878ad70d0bbd26cf3;p=qemu-xen.git 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 --- 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);