From: Will Deacon <will@kernel.org>
To: Marco Elver <elver@google.com>
Cc: paulmck@kernel.org, dvyukov@google.com, glider@google.com,
andreyknvl@google.com, kasan-dev@googlegroups.com,
linux-kernel@vger.kernel.org, apw@canonical.com, joe@perches.com
Subject: Re: [PATCH] checkpatch: Warn about data_race() without comment
Date: Wed, 1 Apr 2020 11:32:20 +0100 [thread overview]
Message-ID: <20200401103219.GB17575@willie-the-truck> (raw)
In-Reply-To: <20200401101714.44781-1-elver@google.com>
On Wed, Apr 01, 2020 at 12:17:14PM +0200, Marco Elver wrote:
> Warn about applications of data_race() without a comment, to encourage
> documenting the reasoning behind why it was deemed safe.
>
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: Marco Elver <elver@google.com>
> ---
> scripts/checkpatch.pl | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a63380c6b0d2..48bb9508e300 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5833,6 +5833,14 @@ sub process {
> }
> }
>
> +# check for data_race without a comment.
> + if ($line =~ /\bdata_race\s*\(/) {
> + if (!ctx_has_comment($first_line, $linenr)) {
> + WARN("DATA_RACE",
> + "data_race without comment\n" . $herecurr);
> + }
> + }
> +
Thanks, looks sane to me:
Acked-by: Will Deacon <will@kernel.org>
Although I suppose I now need to add some comments to my list stuff. I
didn't think that through, did I? ;)
Will
next prev parent reply other threads:[~2020-04-01 10:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 10:17 [PATCH] checkpatch: Warn about data_race() without comment Marco Elver
2020-04-01 10:32 ` Will Deacon [this message]
2020-04-01 15:17 ` Joe Perches
2020-04-01 15:38 ` Paul E. McKenney
2020-04-02 2:20 ` [PATCH] checkpatch: Look for c99 comments in ctx_locate_comment Joe Perches
2020-04-02 3:12 ` Paul E. McKenney
2020-04-16 9:27 ` [PATCH] checkpatch: Warn about data_race() without comment Marco Elver
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=20200401103219.GB17575@willie-the-truck \
--to=will@kernel.org \
--cc=andreyknvl@google.com \
--cc=apw@canonical.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=joe@perches.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@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;
as well as URLs for NNTP newsgroup(s).