checkpatch: don't warn on bitfield spaces around :
authorJoe Perches <joe@perches.com>
Thu, 3 Apr 2014 21:49:33 +0000 (14:49 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 23:21:16 +0000 (16:21 -0700)
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>
scripts/checkpatch.pl

index d3dcb37..34eb216 100755 (executable)
@@ -3138,10 +3138,13 @@ sub process {
                                # // is a comment
                                } elsif ($op eq '//') {
 
+                               #   :   when part of a bitfield
+                               } elsif ($opv eq ':B') {
+                                       # skip the bitfield test for now
+
                                # No spaces for:
                                #   ->
-                               #   :   when part of a bitfield
-                               } elsif ($op eq '->' || $opv eq ':B') {
+                               } elsif ($op eq '->') {
                                        if ($ctx =~ /Wx.|.xW/) {
                                                if (ERROR("SPACING",
                                                          "spaces prohibited around that '$op' $at\n" . $hereptr)) {