The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: linux-kernel@vger.kernel.org, Joe Perches <joe@perches.com>,
	Simon Glass <sjg@chromium.org>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH 1/1] checkpatch: Skip CamelCase cache for --no-tree without root
Date: Thu, 2 Jul 2026 23:28:35 +0200	[thread overview]
Message-ID: <20260702212835.GA359084@pevik> (raw)
In-Reply-To: <20260528130952.GA261301@pevik>

Hi,

> > Running outside tree (--no-tree) without git root (--root DIR) is not
> > doable because we have no include/ directory which could be cached. But
> > 3445686af721 expected that we are always in Linux tree (w/a git).
> > But --no-tree does not require --root. Therefore skip whole caching in
> > that case.

> > This fixes perl and find errors when running checkpatch.pl *with*
> > --no-tree --strict and *without* --root:

> >     No structs that should be const will be found - file 'scripts/const_structs.checkpatch': No such file or directory
> >     Use of uninitialized value $root in concatenation (.) or string at scripts/checkpatch.pl line 1213.
> >     find: ‘/include’: No such file or directory

> > Fixes: 3445686af721 ("checkpatch: ignore existing CamelCase uses from include/...")
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > NOTE: I found that running checkpatch.pl on projects which vendored
> > checkpatch.pl (e.g. LTP or u-boot).

> >  scripts/checkpatch.pl | 2 ++
> >  1 file changed, 2 insertions(+)

> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 0d18771f1b01..939d2b9ecebd 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -1208,6 +1208,8 @@ sub seed_camelcase_includes {
> >  		my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`;
> >  		chomp $git_last_include_commit;
> >  		$camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit";
> > +	} elsif (not defined $root) {
> > +		return;
> >  	} else {
> >  		my $last_mod_date = 0;
> >  		$files = `find $root/include -name "*.h"`;

Gently ping for a review.

Kind regards,
Petr

      reply	other threads:[~2026-07-02 21:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 16:14 [PATCH 1/1] checkpatch: Skip CamelCase cache for --no-tree without root Petr Vorel
2026-05-28 13:09 ` Petr Vorel
2026-07-02 21:28   ` Petr Vorel [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=20260702212835.GA359084@pevik \
    --to=pvorel@suse.cz \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=sjg@chromium.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