History

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.

Joe Perches committed 9 years ago

Commit 45c55e91 parent 77cb8541 file · +6 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+6−0
@@ -5287,6 +5287,12 @@ sub process { · 5286 unmodified lines
52875287 }
52885288 }
52895289
5290+# check for logging continuations
5291+ if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) {
5292+ WARN("LOGGING_CONTINUATION",
5293+ "Avoid logging continuation uses where feasible\n" . $herecurr);
5294+ }
5295+
52905296 # check for mask then right shift without a parentheses
52915297 if ($^V && $^V ge 5.10.0 &&
52925298 $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ &&