History

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.

Marco Elver committed 6 years ago

Commit 5099a721 parent 52785b61 file · +8 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+8−0
@@ -5833,6 +5833,14 @@ sub process { · 5832 unmodified lines
58335833 }
58345834 }
58355835
5836+# check for data_race without a comment.
5837+ if ($line =~ /\bdata_race\s*\(/) {
5838+ if (!ctx_has_comment($first_line, $linenr)) {
5839+ WARN("DATA_RACE",
5840+ "data_race without comment\n" . $herecurr);
5841+ }
5842+ }
5843+
58365844 # check for smp_read_barrier_depends and read_barrier_depends
58375845 if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) {
58385846 WARN("READ_BARRIER_DEPENDS",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t