public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>, Andy Whitcroft <apw@canonical.com>,
	Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 2/2] checkpatch: skip directories in file checking mode
Date: Tue,  8 Apr 2014 08:25:05 -0500	[thread overview]
Message-ID: <1396963505-11119-2-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1396963505-11119-1-git-send-email-robherring2@gmail.com>

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


  reply	other threads:[~2014-04-08 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 13:25 [PATCH 1/2] checkpatch: fix wildcard DT compatible string checking Rob Herring
2014-04-08 13:25 ` Rob Herring [this message]
2014-04-08 15:06   ` [PATCH 2/2] checkpatch: skip directories in file checking mode Joe Perches
2014-04-08 15:03 ` [PATCH 1/2] checkpatch: fix wildcard DT compatible string checking Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396963505-11119-2-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox