lkml.org 
[lkml]   [2010]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] checkpatch.pl: Add check for space after struct or union definition
From
Date
Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd88f11..59084fe 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1876,6 +1876,16 @@ sub process {
ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
}

+# missing space after union or struct definition
+ if ($rawline =~ /^\+\s*(union|struct)\s+$Ident[=\{]/) {
+ WARN("Missing space after struct or union definition\n" . $herecurr);
+ }
+
+# missing space after enum definition
+ if ($rawline =~ /^\+\s*enum\{/) {
+ WARN("Missing space after enum definition\n" . $herecurr);
+ }
+
# open braces for enum, union and struct go on the same line.
if ($line =~ /^.\s*{/ &&
$prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) {



\
 
 \ /
  Last update: 2010-06-17 11:59    [W:4.676 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site