lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Oct 2013 13:20:53 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	Joe Perches <joe@...ches.com>
Cc:	linux-kernel@...r.kernel.org,
	Nandini Hanumanthagowda <nandu.hgowda@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andy Whitcroft <apw@...onical.com>
Subject: Re: [PATCH] checkpatch: Allow spaces before the ':' of a bitfield

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.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists