public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Find CamelCase definitions of struct/union/enum
@ 2013-09-24 18:38 Joe Perches
  2013-09-25 15:24 ` Al Viro
  0 siblings, 1 reply; 15+ messages in thread
From: Joe Perches @ 2013-09-24 18:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andy Whitcroft, LKML

Checkpatch doesn't currently find CamelCase definitions
of structs, unions or enums.

Add that ability.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c03e427..3d51710 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -442,8 +442,9 @@ sub seed_camelcase_file {
 		next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/);
 		if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) {
 			$camelcase{$1} = 1;
-		}
-	        elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) {
+		} elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) {
+			$camelcase{$1} = 1;
+		} elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[;\{]/) {
 			$camelcase{$1} = 1;
 		}
 	}



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-09-26  1:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-24 18:38 [PATCH] checkpatch: Find CamelCase definitions of struct/union/enum Joe Perches
2013-09-25 15:24 ` Al Viro
2013-09-25 15:35   ` Joe Perches
2013-09-25 16:19     ` Al Viro
2013-09-25 17:27       ` Alexander Holler
2013-09-25 19:22       ` Joe Perches
2013-09-25 19:30         ` Theodore Ts'o
2013-09-25 19:48           ` Joe Perches
2013-09-25 19:54             ` Alexander Holler
2013-09-25 20:03               ` Andrew Morton
2013-09-25 20:23                 ` Al Viro
2013-09-26  1:10                 ` Theodore Ts'o
2013-09-26  1:13                   ` Andrew Morton
2013-09-25 20:11         ` Al Viro
2013-09-26  0:38           ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox