public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch.pl: Allow > 80 char lines for logging functions not just printk
@ 2009-10-03  0:10 Joe Perches
  2009-10-26 11:16 ` Andy Whitcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2009-10-03  0:10 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Andrew Morton, LKML

Signed-off-by: Joe Perches <joe@perches.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 87bbb8b..ae74ab1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -186,6 +186,14 @@ our $typeTypedefs = qr{(?x:
 	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 = (
 	qr{void},
 	qr{(?:unsigned\s+)?char},
@@ -1367,7 +1375,7 @@ sub process {
 #80 column limit
 		if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
 		    $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)
 		{
 			WARN("line over 80 characters\n" . $herecurr);



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-26 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-03  0:10 [PATCH] checkpatch.pl: Allow > 80 char lines for logging functions not just printk Joe Perches
2009-10-26 11:16 ` Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox