Messages in this thread Patch in this message | | | From | Joe Perches <> | Subject | [PATCH 2/2] checkpatch: Don't warn on bitfield spaces around : | Date | Mon, 31 Mar 2014 14:58:08 -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.
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Joe Perches <joe@perches.com> --- scripts/checkpatch.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ac0169c..70c932b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3153,10 +3153,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)) { -- 1.8.1.2.459.gbcd45b4.dirty
| |