From: Joe Perches Date: Wed, 3 Jul 2013 22:05:33 +0000 (-0700) Subject: checkpatch: ignore SI unit CamelCase variants like "_uV" X-Git-Tag: v3.11-rc1~99^2~222 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=22735ce857a2d9f4e6eec37c36be3fcf9d21d154;p=karo-tx-linux.git checkpatch: ignore SI unit CamelCase variants like "_uV" Many existing variable names use SI like variants that should be otherwise obvious and acceptable. Whitelist them from the CamelCase message. Signed-off-by: Joe Perches Suggested-by: Phil Carmody Acked-by: Phil Carmody Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5989415985ae..7e8aa1bb0721 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3195,7 +3195,10 @@ sub process { #CamelCase if ($var !~ /^$Constant$/ && $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && +#Ignore Page variants $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show) + $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ && !defined $camelcase{$var}) { $camelcase{$var} = 1; CHK("CAMELCASE",