mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jerome Forissier <jerome.forissier@linaro.org>
To: Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: don't match against empty $const_structs
Date: Thu, 20 Oct 2016 10:18:00 +0200	[thread overview]
Message-ID: <bc553cb0-5bd5-ea08-bfc4-c75d2ce0ddf3@linaro.org> (raw)
In-Reply-To: <1476951388.21931.0.camel@perches.com>



On 10/20/2016 10:16 AM, Joe Perches wrote:
> On Thu, 2016-10-20 at 10:12 +0200, Jerome Forissier wrote:
>> When $conststructsfile does not exist or is empty, we may get false
>> warnings such as:
>> WARNING: struct  should normally be const
>>
>> Fix that by not running the string match if $const_structs is empty.
> 
> Why should $const_structs ever be empty?

When running out-of-tree, i.e., using checkpatch.pl on non-kernel sources.

> 
>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
>> ---
>>  scripts/checkpatch.pl | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index a8368d1..722a319 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -6010,7 +6010,8 @@ sub process {
>>  		}
>>  
>>  # check for various structs that are normally const (ops, kgdb, device_tree)
>> -		if ($line !~ /\bconst\b/ &&
>> +		if ($const_structs ne "" &&
>> +		    $line !~ /\bconst\b/ &&
>>  		    $line =~ /\bstruct\s+($const_structs)\b/) {
>>  			WARN("CONST_STRUCT",
>>  			     "struct $1 should normally be const\n" .
>>

  reply	other threads:[~2016-10-20  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  8:12 Jerome Forissier
2016-10-20  8:16 ` Joe Perches
2016-10-20  8:18   ` Jerome Forissier [this message]
2016-10-20  8:25     ` 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=bc553cb0-5bd5-ea08-bfc4-c75d2ce0ddf3@linaro.org \
    --to=jerome.forissier@linaro.org \
    --cc=apw@canonical.com \
    --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®