[PATCH v2] checkpatch: Allow longer logging function names

From: Joe Perches
Date: Wed Jun 19 2013 - 18:49:14 EST


From: Jacob Keller <jacob.e.keller@xxxxxxxxx>

The current $logFunction regular expression allows names like
dev_warn, e_dbg, netdev_info, etc, but some log functions are now
written like e_dev_warn, so allow 1 or 2 word blocks with an
underscore before the logging level.

Signed-off-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>
Tested-by: Aaron Brown <aaron.f.brown@xxxxxxxxx>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>
Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
jp: Modified Jacob's patch and commit message to limit the number of
word blocks because foo_bar_baz_dev_warn is just too long to live.

scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7e8aa1b..1034c9b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -280,7 +280,7 @@ our $typeTypedefs = qr{(?x:

our $logFunctions = qr{(?x:
printk(?:_ratelimited|_once|)|
- [a-z0-9]+_(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
+ (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
WARN(?:_RATELIMIT|_ONCE|)|
panic|
MODULE_[A-Z_]+
--
1.8.1.2.459.gbcd45b4.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/