diff mbox series

[PULL,31/35] checkpatch: warn about qemu/queue.h head structs that are not typedef-ed

Message ID 20181217231700.24482-32-pbonzini@redhat.com
State New
Headers show
Series [PULL,01/35] accel: Improve selection of the default accelerator | expand

Commit Message

Paolo Bonzini Dec. 17, 2018, 11:16 p.m. UTC
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 | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index df2da09b06..440d95d117 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2262,6 +2262,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);