Skip to contentSkip to conversation

checkpatch: don't warn for space after for_each_* macros

PATCH New Andi Kleen 1 participant 1 message May 31, 2010 Checkpatch

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 checkpatch: don't warn for space after for_each_* macros

checkpatch: don't warn for space after for_each_* macros

for_each_possible_cpu and similar macros act like loops and it's natural for them to be written like while () with a space before the paren.

Unfortunately checkpatch.pl warns about this:

WARNING: space prohibited between function name and open parenthesis '('
+ for_each_possible_cpu (cpu) {

Don't warn for all function names matching a reasonable for_each pattern.

scripts/checkpatch.pl +1 -0
index bd88f11..c35eda2 100755
@@ -1906,6 +1906,7 @@ sub process {
 				if|for|while|switch|return|case|
 				volatile|__volatile__|
 				__attribute__|format|__extension__|
+				([a-z]+_)?for_each_[a-z_]+|
 				asm|__asm__)$/x)
 			{