checkpatch: make the memory barrier test noisier

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 <joe@perches.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: c1fd7bb99637e69994d26df5f6e33192319d3866
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
This commit is contained in:
Joe Perches 2013-11-12 15:10:11 -08:00 committed by Stepan Moskovchenko
parent fdff530519
commit 99219ab56b
1 changed files with 2 additions and 2 deletions

View File

@ -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