History

checkpatch: complex macros checks miss square brackets

We are missing 'simple' values which include square brackets. Refactor to ensure we handle nesting correctly and detect these simple forms.

Andy Whitcroft committed 18 years ago

Commit bf30d6e1 parent f16fa281 file · +4 −3Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+4−3
@@ -2142,9 +2142,10 @@ sub process { · 2141 unmodified lines
21422142 $dstat =~ s/\s*$//s;
21432143
21442144 # Flatten any parentheses and braces
2145− while ($dstat =~ s/\([^\(\)]*\)/1/) {
2146− }
2147− while ($dstat =~ s/\{[^\{\}]*\}/1/) {
2145+ while ($dstat =~ s/\([^\(\)]*\)/1/ ||
2146+ $dstat =~ s/\{[^\{\}]*\}/1/ ||
2147+ $dstat =~ s/\[[^\{\}]*\]/1/)
2148+ {
21482149 }
21492150
21502151 my $exceptions = qr{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t