mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Simon Glass <sjg@chromium.org>
Cc: linux-kernel@vger.kernel.org, Joe Perches <joe@perches.com>,
	Rob Herring <robh@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Whitcroft <apw@canonical.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Kory Maincent <kory.maincent@bootlin.com>,
	Tom Rini <trini@konsulko.com>,
	Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: Re: [PATCH v3 2/2] checkpatch: Add option to not force /* */ for SPDX
Date: Mon, 13 Apr 2026 10:24:49 +0200	[thread overview]
Message-ID: <20260413082449.GB117516@pevik> (raw)
In-Reply-To: <CAFLszTjcUe1DqCvOH3FJoeqS40kSwFLQuGGio3X9H+JP6kYj=A@mail.gmail.com>

> Hi Petr,

> On Wed, 8 Apr 2026 at 06:06, Petr Vorel <pvorel@suse.cz> wrote:

> > Add option --ignore-old-toolchain to not force /* */ for SPDX.

> > As documented in aa19a176df95d6, this is required for some old
> > toolchains still have older assembler tools which cannot handle C++
> > style comments. This allows avoid forcing this for for projects which
> > vendored checkpatch.pl (e.g. LTP or u-boot).

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > New in v3.

> > I suppose you will not want to add code which should not be used on
> > mainline. But it would help to not force other projects which vendored
> > checkpatch.pl to neither force /* */ nor carry extra patch.

> > I wonder if this rule is still relevant (are these old toolchains still
> > being used).

> > Kind regards,
> > Petr

> >  scripts/checkpatch.pl | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)

> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 58f3d5a98204c..ec1e9670a0c1d 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -61,6 +61,7 @@ my $def_configuration_dirs = ".:$ENV{HOME}:.scripts";
> >  my $env_config_dir = 'CHECKPATCH_CONFIG_DIR';
> >  my $max_line_length = 100;
> >  my $ignore_perl_version = 0;
> > +my $ignore_old_toolchain = 0;
> >  my $minimum_perl_version = 5.10.0;
> >  my $min_conf_desc_length = 4;
> >  my $spelling_file = "$D/spelling.txt";
> > @@ -137,6 +138,9 @@ Options:
> >                               file.  It's your fault if there's no backup or git
> >    --ignore-perl-version      override checking of perl version.  expect
> >                               runtime errors.
> > +  --ignore-old-toolchain     don't force C++ comments (/* */) for SPDX license
> > +                             (required by old toolchains). NOTE: it should *not*
> > +                             be used for Linux mainline.
> >    --codespell                Use the codespell dictionary for spelling/typos
> >                               (default:$codespellfile)
> >    --codespellfile            Use this codespell dictionary
> > @@ -346,6 +350,7 @@ GetOptions(
> >         'fix!'          => \$fix,
> >         'fix-inplace!'  => \$fix_inplace,
> >         'ignore-perl-version!' => \$ignore_perl_version,
> > +       'ignore-old-toolchain!' => \$ignore_old_toolchain,
> >         'debug=s'       => \%debug,
> >         'test-only=s'   => \$tst_only,
> >         'codespell!'    => \$codespell,
> > @@ -3812,7 +3817,7 @@ sub process {
> >                         } elsif ($rawline =~ /^\+/) {
> >                                 my $comment = "";
> >                                 if ($realfile =~ /\.(h|s|S)$/) {
> > -                                       $comment = '/*';
> > +                                       $comment = $ignore_old_toolchain ? '//' : '/*';
> >                                 } elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) {
> >                                         $comment = '//';
> >                                 } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) {
> > --
> > 2.53.0


> Is the help text swapped? To my mind /* */ is C-style.

+1, thanks for catching this.

> The option name is quite generic for something that only controls SPDX
> comment style - how about --spdx-cxx-comments ?

Good point, I'll change it in v4.

Kind regards,
Petr

> Regards,
> Simon

  reply	other threads:[~2026-04-13  8:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 12:06 [PATCH v3 1/2] checkpatch: Allow to pass config directory Petr Vorel
2026-04-08 12:06 ` [PATCH v3 2/2] checkpatch: Add option to not force /* */ for SPDX Petr Vorel
2026-04-11 19:49   ` Simon Glass
2026-04-13  8:24     ` Petr Vorel [this message]
2026-04-11 19:49 ` [PATCH v3 1/2] checkpatch: Allow to pass config directory Simon Glass
2026-04-13  8:22   ` Petr Vorel

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=20260413082449.GB117516@pevik \
    --to=pvorel@suse.cz \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=kory.maincent@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=robh@kernel.org \
    --cc=sjg@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=trini@konsulko.com \
    --cc=visitorckw@gmail.com \
    /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

Powered by JetHome