فهرست منبع

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.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Whitcroft 16 سال پیش
والد
کامیت
5368df20fb
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      scripts/checkpatch.pl

+ 4 - 3
scripts/checkpatch.pl

@@ -1241,9 +1241,6 @@ sub process {
 #ignore lines being removed
 #ignore lines being removed
 		if ($line=~/^-/) {next;}
 		if ($line=~/^-/) {next;}
 
 
-# check we are in a valid source file if not then ignore this hunk
-		next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
-
 #trailing whitespace
 #trailing whitespace
 		if ($line =~ /^\+.*\015/) {
 		if ($line =~ /^\+.*\015/) {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
@@ -1253,6 +1250,10 @@ sub process {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
 			ERROR("trailing whitespace\n" . $herevet);
 			ERROR("trailing whitespace\n" . $herevet);
 		}
 		}
+
+# check we are in a valid source file if not then ignore this hunk
+		next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
+
 #80 column limit
 #80 column limit
 		if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
 		if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
 		    $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
 		    $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&