From: Joe Perches <joe@perches.com>
To: Christian Gromm <christian.gromm@microchip.com>
Cc: Andy Whitcroft <apw@canonical.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts: checkpatch: remove preceding dot-slash from path name
Date: Thu, 29 Oct 2015 06:46:46 -0700 [thread overview]
Message-ID: <1446126406.2757.160.camel@perches.com> (raw)
In-Reply-To: <1446124009-26947-1-git-send-email-christian.gromm@microchip.com>
On Thu, 2015-10-29 at 14:06 +0100, Christian Gromm wrote:
> In case checkpatch is called with a path name that starts with ./ for
> the current directory not all issues are being reported since internal
> path checks don't succeed. This patch removes the leading './' from
> $filename. This is needed to have checkpatch report all issues found
> during execution.
>
> Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
> ---
> scripts/checkpatch.pl | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index f2a1131..44435fd 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -730,6 +730,9 @@ my $fixlinenr = -1;
> my $vname;
> for my $filename (@ARGV) {
> my $FILE;
> + if ($filename =~ /^(\.\/)/) {
> + substr($filename, 0, 2) = "";
> + }
If you are going to attempt to do pathname translations,
please do it comprehensively using something like realpath.
$ cd <linux source tree path>
$ cd drivers/staging
$ <path if necessary>checkpatch.pl -f ./<file>
And it should be done for the files contained
in a patch too.
thanks.
> if ($file) {
> open($FILE, '-|', "diff -u /dev/null $filename") ||
> die "$P: $filename: diff failed - $!\n";
prev parent reply other threads:[~2015-10-29 13:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-29 13:06 [PATCH] scripts: checkpatch: remove preceding dot-slash from path name Christian Gromm
2015-10-29 13:46 ` Joe Perches [this message]
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=1446126406.2757.160.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=christian.gromm@microchip.com \
--cc=linux-kernel@vger.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