mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
checkpatch: change CamelCase test and make it --strict
Do not bleat a message on nominally acceptable CamelCase uses that are separated by an _ like drm_core_has_MTRR. CamelCase tests are also a bit noisy against certain types of code acceptable to some kernel developers. Make the test applicable only with --strict. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
64df3071a9
commit
be79794bc1
@ -2938,12 +2938,12 @@ sub process {
|
|||||||
while ($line =~ m{($Constant|$Lval)}g) {
|
while ($line =~ m{($Constant|$Lval)}g) {
|
||||||
my $var = $1;
|
my $var = $1;
|
||||||
if ($var !~ /$Constant/ &&
|
if ($var !~ /$Constant/ &&
|
||||||
$var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
|
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
|
||||||
$var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
|
$var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
|
||||||
!defined $camelcase{$var}) {
|
!defined $camelcase{$var}) {
|
||||||
$camelcase{$var} = 1;
|
$camelcase{$var} = 1;
|
||||||
WARN("CAMELCASE",
|
CHK("CAMELCASE",
|
||||||
"Avoid CamelCase: <$var>\n" . $herecurr);
|
"Avoid CamelCase: <$var>\n" . $herecurr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user