提交 dcaf1123 编写于 作者: P Paolo Bonzini 提交者: Linus Torvalds

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: NPaolo Bonzini <pbonzini@redhat.com>
Cc: Andy Whitcroft <apw@canonical.com>
Acked-by: NJoe Perches <joe@perches.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e23ef1f3
......@@ -4547,7 +4547,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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册