qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 31/35] checkpatch: warn about qemu/queue.h head struc


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 31/35] checkpatch: warn about qemu/queue.h head structs that are not typedef-ed
Date: Wed, 19 Dec 2018 16:19:13 +0100

These are just like any other struct or union, so they should have
CamelCase typedefs.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 scripts/checkpatch.pl | 5 +++++
 1 file changed, 5 insertions(+)

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);
-- 
2.20.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]