Warn about applications of data_race() without a comment, to encourage documenting the reasoning behind why it was deemed safe.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -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_depends | 5844 | # 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", |