Skip to content

Commit dcaf112

Browse files
bonzinitorvalds
authored andcommitted
checkpatch: fix UNNECESSARY_KERN_LEVEL false positive
KERN_<LEVEL> is never redundant with printk_ratelimited or printk_once. (Except perhaps in the sense that you could use e.g. pr_err_ratelimited or pr_err_once, but that would apply to printk as well). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Andy Whitcroft <apw@canonical.com> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e23ef1f commit dcaf112

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4547,7 +4547,7 @@ sub process {
45474547
}
45484548

45494549
# check for logging functions with KERN_<LEVEL>
4550-
if ($line !~ /printk\s*\(/ &&
4550+
if ($line !~ /printk(?:_ratelimited|_once)?\s*\(/ &&
45514551
$line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) {
45524552
my $level = $1;
45534553
if (WARN("UNNECESSARY_KERN_LEVEL",

0 commit comments

Comments
 (0)