lkml.org 
[lkml]   [2014]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] checkpatch: skip directories in file checking mode
Date
From: Rob Herring <robh@kernel.org>

Running checkpatch.pl on a list of files using a wildcard will exit if
a directory is encountered. For example:

$ scripts/checkpatch.pl -f arch/*
diff: arch/alpha/null: No such file or directory

The correct operation is arch/Kconfig should be checked. Fix this by
skipping files which are not regular files.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0e960b1..b646b95 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -552,6 +552,7 @@ my $vname;
for my $filename (@ARGV) {
my $FILE;
if ($file) {
+ next if (!(-f $filename));
open($FILE, '-|', "diff -u /dev/null $filename") ||
die "$P: $filename: diff failed - $!\n";
} elsif ($filename eq '-') {
--
1.9.1


\
 
 \ /
  Last update: 2014-04-08 16:01    [W:0.042 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site