aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-10-16 01:02:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:36 -0400
commit5368df20fb364e394da3ab88d3d60ee3c0a9e5ba (patch)
treeb81cf91c95ab0eb2014c6c62d3bec1491d2ff6cd /scripts/checkpatch.pl
parent81bc0e020232a1e1e7010376382bb59ca82927ac (diff)
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 18646f076a84..a2e4a3d9c6d7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1241,9 +1241,6 @@ sub process {
1241#ignore lines being removed 1241#ignore lines being removed
1242 if ($line=~/^-/) {next;} 1242 if ($line=~/^-/) {next;}
1243 1243
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
1247#trailing whitespace 1244#trailing whitespace
1248 if ($line =~ /^\+.*\015/) { 1245 if ($line =~ /^\+.*\015/) {
1249 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1246 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
@@ -1253,6 +1250,10 @@ sub process {
1253 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1250 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
1254 ERROR("trailing whitespace\n" . $herevet); 1251 ERROR("trailing whitespace\n" . $herevet);
1255 } 1252 }
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
1256#80 column limit 1257#80 column limit
1257 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && 1258 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
1258 $rawline !~ /^.\s*\*\s*\@$Ident\s/ && 1259 $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&