History

checkpatch: check line endings in text format files

Firmware may be included in the kernel as .ihex files. These are inherantly text, but not source. The line ending checks are applicable to these kinds of file, allow just these checks to apply to all files.

Andy Whitcroft committed 18 years ago

Commit 5368df21 parent 81bc0e01 file · +4 −3Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+4−3
@@ -1241,9 +1241,6 @@ sub process { · 1240 unmodified lines
12411241 #ignore lines being removed
12421242 if ($line=~/^-/) {next;}
12431243
1244−# check we are in a valid source file if not then ignore this hunk
1245− next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
1246−
12471244 #trailing whitespace
12481245 if ($line =~ /^\+.*\015/) {
12491246 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
@@ -1253,6 +1250,10 @@ sub process { · 3 unmodified lines
12531250 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
12541251 ERROR("trailing whitespace\n" . $herevet);
12551252 }
1253+
1254+# check we are in a valid source file if not then ignore this hunk
1255+ next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
1256+
12561257 #80 column limit
12571258 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
12581259 $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&