summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2017-02-08 10:28:00 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-02-08 10:28:00 +1100
commit01d2b0781d6ce46737f1b0b623a775d4e1366eab (patch)
treee6bc2eb1042ca0496ea3e5a31f54fc58f353623f /scripts
parent7bd053aa7112a620731fa212bc8e1f017f487c1a (diff)
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
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*>>/ &&