[<prev] [next>] [day] [month] [year] [list]
Message-ID: <158894559107.8414.10179815229224016471.tip-bot2@tip-bot2>
Date: Fri, 08 May 2020 13:46:31 -0000
From: "tip-bot2 for Marco Elver" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Will Deacon <will@...nel.org>, Marco Elver <elver@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: locking/kcsan] checkpatch: Warn about data_race() without comment
The following commit has been merged into the locking/kcsan branch of tip:
Commit-ID: 5099a722e9727fe9a93fac51e961735f40e5b6c8
Gitweb: https://git.kernel.org/tip/5099a722e9727fe9a93fac51e961735f40e5b6c8
Author: Marco Elver <elver@...gle.com>
AuthorDate: Wed, 01 Apr 2020 12:17:14 +02:00
Committer: Paul E. McKenney <paulmck@...nel.org>
CommitterDate: Wed, 06 May 2020 10:54:58 -07:00
checkpatch: Warn about data_race() without comment
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@...nel.org>
Signed-off-by: Marco Elver <elver@...gle.com>
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
---
scripts/checkpatch.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a63380c..48bb950 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);
+ }
+ }
+
# check for smp_read_barrier_depends and read_barrier_depends
if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) {
WARN("READ_BARRIER_DEPENDS",
Powered by blists - more mailing lists