mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH] checkpatch: always allow C99 SPDX License Identifer comments
Date: Wed, 11 Mar 2020 19:48:52 -0700	[thread overview]
Message-ID: <7056bd62-4251-f9bb-2b97-15f93a1e7142@broadcom.com> (raw)
In-Reply-To: <2c4b42d1fb0bdb6604a72b2a10d49f9eae4b0ff4.camel@perches.com>

Hi Joe,

On 2020-03-11 7:26 p.m., Joe Perches wrote:
> On Wed, 2020-03-11 at 12:11 -0700, Scott Branden wrote:
>> Always allow C99 comment styles if SPDK-License-Identifier is in comment
>> even if C99_COMMENT_TOLERANCE is specified in the --ignore options.
> Why is this useful?
This is useful because if you run checkpatch with 
--ignore=C99_COMMENT_TOLERANCE
right now it will warn on almost every .c file in the linux kernel due 
to the decision to
use // SPDX-License-Identifier: at the start of every c file

With this change checkpatch will stop complaining about this single 
outlier // in the file
and allow you to enforce no other C99 // style comments in the patch.

It would have been a lot nicer if /* SPDX-License-Identifier: xxxx */ 
was used instead...
>
>> Signed-off-by: Scott Branden <scott.branden@broadcom.com>
>> ---
>>   scripts/checkpatch.pl | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index a63380c6b0d2..c8b429dd6b51 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -3852,8 +3852,8 @@ sub process {
>>   			}
>>   		}
>>   
>> -# no C99 // comments
>> -		if ($line =~ m{//}) {
>> +# no C99 // comments except for SPDX-License-Identifier
>> +		if ($line =~ m{//} && $rawline !~ /SPDX-License-Identifier:/) {
>>   			if (ERROR("C99_COMMENTS",
>>   				  "do not use C99 // comments\n" . $herecurr) &&
>>   			    $fix) {


  reply	other threads:[~2020-03-12  2:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 19:11 Scott Branden
2020-03-12  2:26 ` Joe Perches
2020-03-12  2:48   ` Scott Branden [this message]
2020-03-12  4:42     ` Joe Perches
2020-03-13  2:47       ` Scott Branden
2020-03-13  8:21     ` [PATCH] checkpatch: No additional checking of SPDX License Identifier necessary Joe Perches

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=7056bd62-4251-f9bb-2b97-15f93a1e7142@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=apw@canonical.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.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

all inboxes | Powered by JetHome®