History

checkpatch: fix 'return is not a function' square bracket handling

We are incorrectly matching square brackets '[' and ']' leading to false positives on more complex functions as below: return (dt3155_fbuffer[m]->ready_head - dt3155_fbuffer[m]->ready_len + dt3155_fbuffer[m]->nbuffers)% (dt3155_fbuffer[m]->nbuffers);

Andy Whitcroft committed 14 years ago

Commit e01886a1 parent 72f115f1 file · +1 −1Browse files

Unified · Split

scripts/checkpatch.pl+1−1
@@ -2609,7 +2609,7 @@ sub process { · 2608 unmodified lines
26092609 # Flatten any parentheses
26102610 $value =~ s/\(/ \(/g;
26112611 $value =~ s/\)/\) /g;
2612− while ($value =~ s/\[[^\{\}]*\]/1/ ||
2612+ while ($value =~ s/\[[^\[\]]*\]/1/ ||
26132613 $value !~ /(?:$Ident|-?$Constant)\s*
26142614 $Compare\s*
26152615 (?:$Ident|-?$Constant)/x &&

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