Commit 691e669b authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch.pl: allow > 80 char lines for logging functions not just printk

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 42bdf74c
...@@ -189,6 +189,14 @@ our $typeTypedefs = qr{(?x: ...@@ -189,6 +189,14 @@ our $typeTypedefs = qr{(?x:
atomic_t atomic_t
)}; )};
our $logFunctions = qr{(?x:
printk|
pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)|
dev_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)|
WARN|
panic
)};
our @typeList = ( our @typeList = (
qr{void}, qr{void},
qr{(?:unsigned\s+)?char}, qr{(?:unsigned\s+)?char},
...@@ -1377,7 +1385,7 @@ sub process { ...@@ -1377,7 +1385,7 @@ sub process {
#80 column limit #80 column limit
if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
$rawline !~ /^.\s*\*\s*\@$Ident\s/ && $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
$line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ && $line !~ /^\+\s*$logFunctions\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
$length > 80) $length > 80)
{ {
WARN("line over 80 characters\n" . $herecurr); WARN("line over 80 characters\n" . $herecurr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment