# 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",
# 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) {
}
}
-# 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);
}