Skip to contentSkip to conversation

checkpatch: fix UNNECESSARY_KERN_LEVEL false positive

PATCH Superseded Paolo Bonzini 2 participants 2 messages Dec 23, 2014 Checkpatch

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: fix UNNECESSARY_KERN_LEVEL false positive

KERN_<LEVEL> is never redundant with printk_ratelimited.

Cc Andy Whitcroft <[email protected]>
Cc Joe Perches <[email protected]>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index f0bb6d60c07b..6b3afe6a3dd3 100755
@@ -4545,7 +4545,7 @@ sub process {
 		}
 
 # check for logging functions with KERN_<LEVEL>
-		if ($line !~ /printk\s*\(/ &&
+		if ($line !~ /printk(?:_ratelimited)?\s*\(/ &&
 		    $line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) {
 			my $level = $1;
 			if (WARN("UNNECESSARY_KERN_LEVEL",
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 1 line · Paolo Bonzini

KERN_<LEVEL> is never redundant with printk_ratelimited.

[]

scripts/checkpatch.pl

Quoted 1 line
scripts/checkpatch.pl +0 -0

[]

scripts/checkpatch.pl sub process { · line 4548

Quoted 6 lines
scripts/checkpatch.pl +1 -1
@@ -4545,7 +4545,7 @@ sub process {
 		}
 
 # check for logging functions with KERN_<LEVEL>
-		if ($line !~ /printk\s*\(/ &&
+		if ($line !~ /printk(?:_ratelimited)?\s*\(/ &&

Seems sensible bu this should probably add _once too

		if ($line !~ /printk(?:_ratelimited|_once)?\s*\(/ &&

Please add and resubmit cc'ing Andrew Morton too.