diff options
author | Joe Perches <joe@perches.com> | 2017-02-25 00:01:31 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-25 02:46:57 +0100 |
commit | 45c55e92fcee992c05737e65ce0b1d7a36edde69 (patch) | |
tree | 20a3ea0079dbe9899f60e5ecec669c2b8249bfea /scripts | |
parent | checkpatch: warn on embedded function names (diff) | |
download | linux-45c55e92fcee992c05737e65ce0b1d7a36edde69.tar.xz linux-45c55e92fcee992c05737e65ce0b1d7a36edde69.zip |
checkpatch: warn on logging continuations
pr_cont(...) and printk(KERN_CONT ...) uses should be discouraged
as their output can be interleaved by multiple logging processes.
Link: http://lkml.kernel.org/r/7100ba00098694ec81471a299583ed068975fd05.1483465888.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4f53093a1b0b..3df2cec47e91 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5287,6 +5287,12 @@ sub process { } } +# check for logging continuations + if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) { + WARN("LOGGING_CONTINUATION", + "Avoid logging continuation uses where feasible\n" . $herecurr); + } + # check for mask then right shift without a parentheses if ($^V && $^V ge 5.10.0 && $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ && |