diff options
author | Joe Perches <joe@perches.com> | 2014-04-03 17:49:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:21:16 -0400 |
commit | b00e48148e99a20c3d81346390d60c7d23826f61 (patch) | |
tree | e81e5d2bbb4578c7d096add661c3b5593e0d0b60 | |
parent | 91cb5195ff224dd9044cf927f80d9c633cdcffec (diff) |
checkpatch: don't warn on bitfield spaces around :
This test prevents code from being aligned around the : for easy visual
counting of bitfield lengths.
ie:
int foo : 1,
int bar : 2,
int foobar :29;
should be acceptable so remove the test.
Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d3dcb370fc37..34eb2160489d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3138,10 +3138,13 @@ sub process { | |||
3138 | # // is a comment | 3138 | # // is a comment |
3139 | } elsif ($op eq '//') { | 3139 | } elsif ($op eq '//') { |
3140 | 3140 | ||
3141 | # : when part of a bitfield | ||
3142 | } elsif ($opv eq ':B') { | ||
3143 | # skip the bitfield test for now | ||
3144 | |||
3141 | # No spaces for: | 3145 | # No spaces for: |
3142 | # -> | 3146 | # -> |
3143 | # : when part of a bitfield | 3147 | } elsif ($op eq '->') { |
3144 | } elsif ($op eq '->' || $opv eq ':B') { | ||
3145 | if ($ctx =~ /Wx.|.xW/) { | 3148 | if ($ctx =~ /Wx.|.xW/) { |
3146 | if (ERROR("SPACING", | 3149 | if (ERROR("SPACING", |
3147 | "spaces prohibited around that '$op' $at\n" . $hereptr)) { | 3150 | "spaces prohibited around that '$op' $at\n" . $hereptr)) { |