Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11ea516a authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: find CamelCase definitions of struct/union/enum



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

Add that ability.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 06668727
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -443,8 +443,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;
		}
	}