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);
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -2609,7 +2609,7 @@ sub process { · 2608 unmodified lines | |||
| 2609 | # Flatten any parentheses | 2609 | # Flatten any parentheses |
| 2610 | $value =~ s/\(/ \(/g; | 2610 | $value =~ s/\(/ \(/g; |
| 2611 | $value =~ s/\)/\) /g; | 2611 | $value =~ s/\)/\) /g; |
| 2612 | while ($value =~ s/\[[^\{\}]*\]/1/ || | 2612 | while ($value =~ s/\[[^\[\]]*\]/1/ || |
| 2613 | $value !~ /(?:$Ident|-?$Constant)\s* | 2613 | $value !~ /(?:$Ident|-?$Constant)\s* |
| 2614 | $Compare\s* | 2614 | $Compare\s* |
| 2615 | (?:$Ident|-?$Constant)/x && | 2615 | (?:$Ident|-?$Constant)/x && |