mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: linux-kernel@vger.kernel.org,
	Nandini Hanumanthagowda <nandu.hgowda@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH] checkpatch: Allow spaces before the ':' of a bitfield
Date: Mon, 14 Oct 2013 13:23:22 -0700	[thread overview]
Message-ID: <1381782202.12919.5.camel@joe-AO722> (raw)
In-Reply-To: <20131014202053.GA4171@jtriplet-mobl1>

On Mon, 2013-10-14 at 13:20 -0700, Josh Triplett wrote:
> On Mon, Oct 14, 2013 at 11:04:38AM -0700, Joe Perches wrote:
> > On Mon, 2013-10-14 at 11:00 -0700, Josh Triplett wrote:
> > > On Mon, Oct 14, 2013 at 10:51:48AM -0700, Joe Perches wrote:
> > > > On Mon, 2013-10-14 at 10:32 -0700, Josh Triplett wrote:
> > > > > checkpatch warns about spaces both before and after the ':' separating a
> > > > > bitfield name from its width.  However, many drivers do put space before
> > > > > the : to line up the widths, which makes the definition significantly
> > > > > more readable; checkpatch should not warn about that.  Remove the
> > > > > warning for space before the ':' of a bitfield.
> > > > 
> > > > There are a _bunch_ of different styles used for
> > > > alignment of bitfields.
> > > > 
> > > > $ grep -rPh --include=*.[ch] \
> > > >   '(?:unsigned\s+|signed\s+|)(char|short|long|long\s+long|\w+_t|(?:__|)(?:u|s)(?:8|16|32|64))\s+\w+\s*:\s*\d+\s*(?:,|;)' *
> > > > 
> > > > spaces before colon
> > > > spaces after colon
> > > > aligned on bitfield size
> > > > 
> > > > I'd just as soon make it a --strict check.
> > > 
> > > I'd be fine with removing the check entirely, or making it --strict;
> > > however, even for --strict mode I'd suggest applying this patch, as I
> > > don't think checkpatch should ever prohibit spaces before the ':'.
> > 
> > Maybe something like that patch, but spaces probably
> > should be prohibited after the : in a bitfield either.
> > 
> > This style is pretty common
> > 
> > 		u32 dma_address0                   :30;
> > 		u32 dma_0No_update                 : 1;
> > 		u32 dma_0start                     : 1;
> > 		u32 dma_addr_size                  :24;
> > 		u32 DMA_maxpackets                 : 8;
> 
> I'm fine with just dropping the check entirely; want a patch for that
> instead?  It's a much simpler patch.

Maybe Andy has an opinion?  He's the one that
wrote almost all of these SPACING checks.



      reply	other threads:[~2013-10-14 20:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20131013121635.GA29395@nandinih-Inspiron-5521>
     [not found] ` <20131013153943.GA27861@kroah.com>
     [not found]   ` <687af3bd-edc6-40cf-b994-0d0fdb7cd30d@googlegroups.com>
2013-10-14 17:32     ` Josh Triplett
2013-10-14 17:51       ` Joe Perches
2013-10-14 18:00         ` Josh Triplett
2013-10-14 18:04           ` Joe Perches
2013-10-14 20:20             ` Josh Triplett
2013-10-14 20:23               ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381782202.12919.5.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nandu.hgowda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®