From: Joe Perches Date: Fri, 24 Feb 2017 23:01:31 +0000 (-0800) Subject: checkpatch: warn on logging continuations X-Git-Tag: v4.14-rc1~1415^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45c55e92fcee992c05737e65ce0b1d7a36edde69;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4f53093..3df2cec 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*>>/ &&