diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index df4250a8ad51..9a89a0609bac 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -3491,6 +3491,14 @@ sub process { | |||
| 3491 | } | 3491 | } |
| 3492 | } | 3492 | } |
| 3493 | 3493 | ||
| 3494 | # check unnecessary parentheses around addressof/dereference single $Lvals | ||
| 3495 | # ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar | ||
| 3496 | |||
| 3497 | while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) { | ||
| 3498 | CHK("UNNECESSARY_PARENTHESES", | ||
| 3499 | "Unnecessary parentheses around $1\n" . $herecurr); | ||
| 3500 | } | ||
| 3501 | |||
| 3494 | #goto labels aren't indented, allow a single space however | 3502 | #goto labels aren't indented, allow a single space however |
| 3495 | if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and | 3503 | if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and |
| 3496 | !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { | 3504 | !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { |
