diff options
author | Andy Whitcroft <apw@shadowen.org> | 2008-10-16 01:02:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:34 -0400 |
commit | 0d413866c7df63794790518e3fd5890969c206ad (patch) | |
tree | 2b5ab7a342959853fc30cb65584b603242f02bf4 | |
parent | fe2a7dbc85f37c721133c83c856f845c4ce9b602 (diff) |
checkpatch: values: double ampersand may be unary
It is possible to use double ampersand (&&) in unary context where it
means the address of a goto label. Handle spacing for it.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6f821a0e0024..114821364c00 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -858,7 +858,7 @@ sub annotate_values { | |||
858 | print "CLOSE($1)\n" if ($dbg_values > 1); | 858 | print "CLOSE($1)\n" if ($dbg_values > 1); |
859 | $type = 'N'; | 859 | $type = 'N'; |
860 | 860 | ||
861 | } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&(?!\&))/o) { | 861 | } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) { |
862 | my $variant; | 862 | my $variant; |
863 | 863 | ||
864 | print "OPV($1)\n" if ($dbg_values > 1); | 864 | print "OPV($1)\n" if ($dbg_values > 1); |
@@ -1634,7 +1634,7 @@ sub process { | |||
1634 | # unary operator, or a cast | 1634 | # unary operator, or a cast |
1635 | } elsif ($op eq '!' || $op eq '~' || | 1635 | } elsif ($op eq '!' || $op eq '~' || |
1636 | $opv eq '*U' || $opv eq '-U' || | 1636 | $opv eq '*U' || $opv eq '-U' || |
1637 | $opv eq '&U') { | 1637 | $opv eq '&U' || $opv eq '&&U') { |
1638 | if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { | 1638 | if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { |
1639 | ERROR("space required before that '$op' $at\n" . $hereptr); | 1639 | ERROR("space required before that '$op' $at\n" . $hereptr); |
1640 | } | 1640 | } |