Whamcloud - gitweb
LU-13817 quota: print error when pool is absent
[fs/lustre-release.git] / contrib / scripts / checkpatch.pl
index f077470..763c205 100755 (executable)
@@ -2714,11 +2714,9 @@ sub process {
 # Check for various typo / spelling mistakes
                if (defined($misspellings) &&
                    ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
-                       while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) {
+                       while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/g) {
                                my $typo = $1;
-                               my $typo_fix = $spelling_fix{lc($typo)};
-                               $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/);
-                               $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/);
+                               my $typo_fix = $spelling_fix{$typo};
                                my $msg_type = \&WARN;
                                $msg_type = \&CHK if ($file);
                                if (&{$msg_type}("TYPO_SPELLING",
@@ -3044,7 +3042,7 @@ sub process {
 
 # Block comment styles
 # Networking with an initial /*
-               if ($realfile =~ m@^(drivers/net/|net/)@ &&
+               if ($realfile =~ m@^(drivers/net/|net/|lnet)@ &&
                    $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
                    $rawline =~ /^\+[ \t]*\*/ &&
                    $realline > 2) {
@@ -5640,16 +5638,16 @@ sub process {
                        }
                }
 
-# Check for __attribute__ packed, prefer __packed
+# Check for __packed, prefer __attribute__ packed
                if ($realfile !~ m@\binclude/uapi/@ &&
-                   $line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) {
+                   $line =~ /\b__packed\b/) {
                        WARN("PREFER_PACKED",
                             "__packed is preferred over __attribute__((packed))\n" . $herecurr);
                }
 
-# Check for __attribute__ aligned, prefer __aligned
+# Check for __aligned, prefer __attribute__ aligned
                if ($realfile !~ m@\binclude/uapi/@ &&
-                   $line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {
+                   $line =~ /\b__aligned\b/) {
                        WARN("PREFER_ALIGNED",
                             "__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr);
                }