aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl19
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9de3a69260e1..1d6e4c541370 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1398,6 +1398,8 @@ sub process {
1398 my %suppress_export; 1398 my %suppress_export;
1399 my $suppress_statement = 0; 1399 my $suppress_statement = 0;
1400 1400
1401 my %camelcase = ();
1402
1401 # Pre-scan the patch sanitizing the lines. 1403 # Pre-scan the patch sanitizing the lines.
1402 # Pre-scan the patch looking for any __setup documentation. 1404 # Pre-scan the patch looking for any __setup documentation.
1403 # 1405 #
@@ -2905,12 +2907,17 @@ sub process {
2905 } 2907 }
2906 } 2908 }
2907 2909
2908#studly caps, commented out until figure out how to distinguish between use of existing and adding new 2910#CamelCase
2909# if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) { 2911 while ($line =~ m{($Constant|$Lval)}g) {
2910# print "No studly caps, use _\n"; 2912 my $var = $1;
2911# print "$herecurr"; 2913 if ($var !~ /$Constant/ &&
2912# $clean = 0; 2914 $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
2913# } 2915 !defined $camelcase{$var}) {
2916 $camelcase{$var} = 1;
2917 WARN("CAMELCASE",
2918 "Avoid CamelCase: <$var>\n" . $herecurr);
2919 }
2920 }
2914 2921
2915#no spaces allowed after \ in define 2922#no spaces allowed after \ in define
2916 if ($line=~/\#\s*define.*\\\s$/) { 2923 if ($line=~/\#\s*define.*\\\s$/) {