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
5833 }5833 }
5834 }5834 }
5835 5835
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
5836# check for smp_read_barrier_depends and read_barrier_depends5844# check for smp_read_barrier_depends and read_barrier_depends
5837 if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) {5845 if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) {
5838 WARN("READ_BARRIER_DEPENDS",5846 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