Skip to content

Commit

Permalink
checkpatch: make the memory barrier test noisier
Browse files Browse the repository at this point in the history
Peter Zijlstra prefers that comments be required near uses of memory
barriers.

Change the message level for memory barrier uses from a --strict test only
to a normal WARN so it's always emitted.

This might produce false positives around insertions of memory barriers
when a comment is outside the patch context block.

And checkpatch is still stupid, it only looks for existence of any
comment, not at the comment content.

Signed-off-by: Joe Perches <[email protected]>
Suggested-by: Peter Zijlstra <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Acked-by: Paul E. McKenney <[email protected]>
Cc: Oliver Neukum <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Nov 13, 2013
1 parent e970b88 commit c1fd7bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3850,8 +3850,8 @@ sub process {
# check for memory barriers without a comment.
if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) {
if (!ctx_has_comment($first_line, $linenr)) {
CHK("MEMORY_BARRIER",
"memory barrier without comment\n" . $herecurr);
WARN("MEMORY_BARRIER",
"memory barrier without comment\n" . $herecurr);
}
}
# check of hardware specific defines
Expand Down

0 comments on commit c1fd7bb

Please sign in to comment.