checkpatch: fix UNNECESSARY_KERN_LEVEL false positive
PATCH v2 1/1 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).
Cc Andy Whitcroft <[email protected]>
Cc Joe Perches <[email protected]>
Cc Andrew Morton <[email protected]>
Signed-off-by Paolo Bonzini <[email protected]>
---
v1->v2: skip printk_once too [Joe Perches]
scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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|_once)?\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
Quoted 3 lines · Paolo Bonzini
KERN_<LEVEL> is never redundant with
printk_ratelimitedorprintk_once. (Except perhaps in the sense that you could use e.g.pr_err_ratelimitedorpr_err_once, but that would apply to printk as well).
[]
Quoted 1 line
v1->v2: skip printk_once too [Joe Perches]
Thanks,
Acked-by Joe Perches <[email protected]>