From: Joe Perches <joe@perches.com>
To: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
"Rob Herring" <robh@kernel.org>,
"Andy Whitcroft" <apw@canonical.com>
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: checkpatch query regarding .c and .h files..
Date: Sun, 02 Jun 2019 11:04:28 -0700 [thread overview]
Message-ID: <f53401a0aba4c20b542ae89860bef371077d693f.camel@perches.com> (raw)
In-Reply-To: <25942.1559494964@turing-police>
On Sun, 2019-06-02 at 13:02 -0400, Valdis Klētnieks wrote:
> scripts/checkpatch.pl contains this code near line 3070:
>
> if ($realfile =~ /\.(h|s|S)$/) {
> $comment = '/*';
> } elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
> $comment = '//';
> } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc)$/) {
> $comment = '#';
> } elsif ($realfile =~ /\.rst$/) {
> $comment = '..';
> }
>
> Was there a specific reason why .h files have /* */ and .c files have C89 // on
> the SPDX comment line?
>
> Would anybody like a patch that fixed checkpatch to allow either flavor on .c and .h files?
> (I know I would, I just blew close to an hour trying to figure out why it whined about a
> SPDX in a .h file I'm getting ready to upstream...)
It's described in Documentation/process/license-rules.rst
----------------------------------
2. Style:
The SPDX license identifier is added in form of a comment. The comment
style depends on the file type::
C source: // SPDX-License-Identifier: <SPDX License Expression>
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
----------------------------------
It was because old versions of build tools could not handle
// in asm files.
It could be changed today because build tool version minimums
have been increased.
prev parent reply other threads:[~2019-06-02 18:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-02 17:02 Valdis Klētnieks
2019-06-02 18:04 ` 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=f53401a0aba4c20b542ae89860bef371077d693f.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
--cc=valdis.kletnieks@vt.edu \
/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®