checkpatch: allow uppercase logging function names
Subsystems (2)
PATCH 1/1 checkpatch: allow uppercase logging function names
Some kernel logging functions are prefixed with uppercase letters such as TP_printk, DUMP_printk, DBG_printk, DEBC_printk, etc. The previous behavior only allowed logging functions (which may exceed the 80 character line limit) to be prefixed by lowercase letters and numbers.
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -343,7 +343,7 @@ our $typeTypedefs = qr{(?x: our $logFunctions = qr{(?x: printk(?:_ratelimited|_once|)| - (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| + (?:[a-zA-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_]+|
Signature · 1 line
1.8.4.5
Joe Perches
maintainerQuoted 4 lines · Wesley Wiser
Some kernel logging functions are prefixed with uppercase letters such as
TP_printk,DUMP_printk,DBG_printk,DEBC_printk, etc. The previous behavior only allowed logging functions (which may exceed the 80 character line limit) to be prefixed by lowercase letters and numbers.
I'm not sure that these should be encouraged.
I'd prefer to make these lower case instead.
The regex also allows mixed case like Tp_printk.
Maybe if it was something like
(?:[a-z0-9]+_|[A-Z0-9]+_){1,2}
but it still seems undesirable.
Quoted 13 lines
scripts/checkpatch.pl new file +1
-1@@ -343,7 +343,7 @@ our $typeTypedefs = qr{(?x: our $logFunctions = qr{(?x: printk(?:_ratelimited|_once|)| - (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| + (?:[a-zA-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_]+|
I think you have to CC Andrew Morton for these. You may as well CC [email protected] also although no one reads that.
regards,
dan carpenter
Hi Joe,
Thanks for taking a look at this. Do you think I should look into fixing the casing of these functions instead? Some of these functions look like they're being called in a lot of places. TP_printk, for example, is getting called over 1000 times according to git grep.
Wesley Wiser
Quoted 9 lines · Joe Perches
I'm not sure that these should be encouraged.
I'd prefer to make these lower case instead.The regex also allows mixed case like
Tp_printk.Maybe if it was something like
(?:[a-z0-9]+_|[A-Z0-9]+_){1,2}but it still seems undesirable.