[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1419341485-31575-1-git-send-email-pbonzini@redhat.com>
Date: Tue, 23 Dec 2014 14:31:25 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH v2] 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 <apw@...onical.com>
Cc: Joe Perches <joe@...ches.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
---
v1->v2: skip printk_once too [Joe Perches]
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f0bb6d60c07b..350cd692a138 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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",
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists