* [PATCH] checkpatch: fix UNNECESSARY_KERN_LEVEL false positive
@ 2014-12-23 13:02 Paolo Bonzini
2014-12-23 13:14 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2014-12-23 13:02 UTC (permalink / raw)
To: linux-kernel; +Cc: Andy Whitcroft, Joe Perches
KERN_<LEVEL> is never redundant with printk_ratelimited.
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f0bb6d60c07b..6b3afe6a3dd3 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)?\s*\(/ &&
$line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) {
my $level = $1;
if (WARN("UNNECESSARY_KERN_LEVEL",
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] checkpatch: fix UNNECESSARY_KERN_LEVEL false positive
2014-12-23 13:02 [PATCH] checkpatch: fix UNNECESSARY_KERN_LEVEL false positive Paolo Bonzini
@ 2014-12-23 13:14 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2014-12-23 13:14 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-kernel, Andy Whitcroft
On Tue, 2014-12-23 at 14:02 +0100, Paolo Bonzini wrote:
> KERN_<LEVEL> is never redundant with printk_ratelimited.
[]
> diff --git 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)?\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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-23 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 13:02 [PATCH] checkpatch: fix UNNECESSARY_KERN_LEVEL false positive Paolo Bonzini
2014-12-23 13:14 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox