From: Joe Perches <joe@perches.com>
To: Jerome Forissier <jerome.forissier@linaro.org>,
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 01:16:28 -0700 [thread overview]
Message-ID: <1476951388.21931.0.camel@perches.com> (raw)
In-Reply-To: <1476951126-30414-1-git-send-email-jerome.forissier@linaro.org>
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?
> 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" .
>
next prev parent reply other threads:[~2016-10-20 8:16 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 [this message]
2016-10-20 8:18 ` Jerome Forissier
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=1476951388.21931.0.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=jerome.forissier@linaro.org \
--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®