checkpatch: Adjust regular expressions in $logFunctions
Subsystems (2)
PATCH 1/1 checkpatch: Adjust regular expressions in $logFunctions
From: Markus Elfring <[email protected]>
Date: Tue, 9 May 2017 20:40:51 +0200
* Two alternations contained an empty element. Use the question mark metacharacter instead to express optional items in the search pattern.
* Some alternation elements shared a common prefix (like an underscore). Improve the specification of this detail by more non-capturing groups.
--- scripts/checkpatch.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/checkpatch.pl +4 -4
@@ -427,12 +427,12 @@ our $typeTypedefs = qr{(?x: our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; our $logFunctions = qr{(?x: - printk(?:_ratelimited|_once|_deferred_once|_deferred|)| - (?:[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|)| + printk(?:_(?:ratelimited|once|deferred(?:_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_]+| - seq_vprintf|seq_printf|seq_puts + seq_(?:v?printf|puts) )}; our $signature_tags = qr{(?xi:
Signature · 1 line
2.12.2
Joe Perches
maintainerQuoted 8 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Tue, 9 May 2017 20:40:51 +0200* Two alternations contained an empty element. Use the question mark metacharacter instead to express optional items in the search pattern.
* Some alternation elements shared a common prefix (like an underscore). Improve the specification of this detail by more non-capturing groups.
No thanks. Perl is odd enough already adding more non-capture
groups when the arguments are clearly specified is harder to read.
Quoted 2 lines
Perl is odd enough already adding more non-capture groups when the arguments are clearly specified is harder to read.
How do you think about to reformat the affected alternations? Will it become appropriate to give each element a separate line there?
Regards,
Markus
Joe Perches
maintainerQuoted 5 lines · SF Markus Elfring
Quoted 2 lines
Perl is odd enough already adding more non-capture groups when the arguments are clearly specified is harder to read.
How do you think about to reformat the affected alternations? Will it become appropriate to give each element a separate line there?
I have no interest in changing checkpatch for no value.
_maybe_, breaking up the file into separate tests in multiple files _could_ be useful.