]> git.proxmox.com Git - mirror_qemu.git/commitdiff
checkpatch: warn about qemu/queue.h head structs that are not typedef-ed
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 6 Dec 2018 11:01:40 +0000 (12:01 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Jan 2019 14:46:55 +0000 (15:46 +0100)
These are just like any other struct or union, so they should have
CamelCase typedefs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl

index 3d1ba9e8ae13fa43ca40714297042dd7bbea754b..d10dddf1be477e52f4ac114243897380639c37c1 100755 (executable)
@@ -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);