mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Tim Bird <tim.bird@sony.com>,
	apw@canonical.com, dwaipayanray1@gmail.com,
		lukas.bulwahn@gmail.com
Cc: linux-spdx@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: add check for missing */ in spdx line
Date: Wed, 04 Feb 2026 14:21:10 -0800	[thread overview]
Message-ID: <9675d6ac5ba6ff51d47177d3802156e2007b494e.camel@perches.com> (raw)
In-Reply-To: <20260204213823.1754560-1-tim.bird@sony.com>

On Wed, 2026-02-04 at 14:38 -0700, Tim Bird wrote:
> Add an explicit check for leading /* but missing */
> to avoid a malformed SPDX line.
> 
> In many cases an SPDX-License-Identifier line immediately
> precedes another C-style comment.  In that case, if
> the SPDX line starts with '/*' but is missing the closing '*/',
> the compiler may not catch it (the leading '/*' on
> the next line and the rest of the header comment is just
> treated as part of the SPDX comment).

Nack.  There too many existing uses.

$ git grep '^/\*.*SPDX' | grep -v '\*/'| wc -l
855

> 
> Signed-off-by: Tim Bird <tim.bird@sony.com>
> ---
>  scripts/checkpatch.pl | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index c0250244cf7a..1cc3fd5e72af 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3794,6 +3794,11 @@ sub process {
>  					WARN("SPDX_LICENSE_TAG",
>  					     "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr);
>  				}
> +				if ($comment eq '/*' &&
> +				    $rawline !~ m@\*/@) {
> +					WARN("SPDX_LICENSE_TAG",
> +					     "Improper SPDX comment style for '$realfile', missing closing '*/'\n" . $herecurr);
> +				}
>  
>  				if ($comment !~ /^$/ &&
>  				    $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) {

      reply	other threads:[~2026-02-04 22:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 21:38 Tim Bird
2026-02-04 22:21 ` 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=9675d6ac5ba6ff51d47177d3802156e2007b494e.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spdx@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=tim.bird@sony.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

all inboxes | Powered by JetHome®