* checkpatch: Does anyone care that comments are freeform aligned? [not found] <alpine.DEB.2.02.1409240745160.2051@localhost6.localdomain6> @ 2014-09-24 18:41 ` Joe Perches 2014-09-26 23:03 ` [OPW kernel] " josh 0 siblings, 1 reply; 3+ messages in thread From: Joe Perches @ 2014-09-24 18:41 UTC (permalink / raw) To: LKML Cc: Julia Lawall, tapaswenipathak, opw-kernel, Andrew Morton, Dan Carpenter, Andy Whitcroft On Wed, 2014-09-24 at 07:47 +0200, Julia Lawall wrote: > In the following patch extract, one line is indented with spaces rather > than tabs. Is it intentional that checkpatch doesn't complain about this, > I guess due to the line being a comment? [] > struct bcm_hdr_suppression_contextinfo { > - UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer to accumulate pkt Header for PHS */ > - UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; /* Intermediate buffer containing pkt Header after PHS */ > + /* Intermediate buffer to accumulate pkt Header for PHS */ > + UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; > + /* Intermediate buffer containing pkt Header after PHS */ > + UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; > }; checkpatch does not care when comments start in any particular position or ensure comments have tabs preceding them. Does anyone care? ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OPW kernel] checkpatch: Does anyone care that comments are freeform aligned? 2014-09-24 18:41 ` checkpatch: Does anyone care that comments are freeform aligned? Joe Perches @ 2014-09-26 23:03 ` josh 2014-09-27 4:58 ` Joe Perches 0 siblings, 1 reply; 3+ messages in thread From: josh @ 2014-09-26 23:03 UTC (permalink / raw) To: Joe Perches Cc: LKML, Julia Lawall, tapaswenipathak, opw-kernel, Andrew Morton, Dan Carpenter, Andy Whitcroft On Wed, Sep 24, 2014 at 11:41:14AM -0700, Joe Perches wrote: > On Wed, 2014-09-24 at 07:47 +0200, Julia Lawall wrote: > > In the following patch extract, one line is indented with spaces rather > > than tabs. Is it intentional that checkpatch doesn't complain about this, > > I guess due to the line being a comment? > [] > > struct bcm_hdr_suppression_contextinfo { > > - UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer to accumulate pkt Header for PHS */ > > - UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; /* Intermediate buffer containing pkt Header after PHS */ > > + /* Intermediate buffer to accumulate pkt Header for PHS */ > > + UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; > > + /* Intermediate buffer containing pkt Header after PHS */ > > + UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; > > }; > > checkpatch does not care when comments start in any > particular position or ensure comments have tabs > preceding them. > > Does anyone care? This should have already been caught by other whitespace checks that check for indentations of 8 or more spaces. Similarly, mixed tab/space indentations would get caught by those same checks. I don't think checkpatch needs to check those. - Josh Triplett ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OPW kernel] checkpatch: Does anyone care that comments are freeform aligned? 2014-09-26 23:03 ` [OPW kernel] " josh @ 2014-09-27 4:58 ` Joe Perches 0 siblings, 0 replies; 3+ messages in thread From: Joe Perches @ 2014-09-27 4:58 UTC (permalink / raw) To: josh Cc: LKML, Julia Lawall, tapaswenipathak, opw-kernel, Andrew Morton, Dan Carpenter, Andy Whitcroft On Fri, 2014-09-26 at 16:03 -0700, josh@joshtriplett.org wrote: > On Wed, Sep 24, 2014 at 11:41:14AM -0700, Joe Perches wrote: > > On Wed, 2014-09-24 at 07:47 +0200, Julia Lawall wrote: > > > In the following patch extract, one line is indented with spaces rather > > > than tabs. Is it intentional that checkpatch doesn't complain about this, > > > I guess due to the line being a comment? > > [] > > > struct bcm_hdr_suppression_contextinfo { > > > - UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; /* Intermediate buffer to accumulate pkt Header for PHS */ > > > - UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; /* Intermediate buffer containing pkt Header after PHS */ > > > + /* Intermediate buffer to accumulate pkt Header for PHS */ > > > + UCHAR ucaHdrSuppressionInBuf[MAX_PHS_LENGTHS]; > > > + /* Intermediate buffer containing pkt Header after PHS */ > > > + UCHAR ucaHdrSuppressionOutBuf[MAX_PHS_LENGTHS + PHSI_LEN]; > > > }; > > > > checkpatch does not care when comments start in any > > particular position or ensure comments have tabs > > preceding them. > > > > Does anyone care? > > This should have already been caught by other whitespace checks that > check for indentations of 8 or more spaces. Similarly, mixed tab/space > indentations would get caught by those same checks. Yes and no. Leading whitespace over 8 chars would (ie: "^ {8,}" is a warning) but a statement like: int foo; /* some comment */ [tab] [20 spaces] [tab] would not. > I don't think checkpatch needs to check those. For the most part, I agree. On Fri, 2014-09-26 at 16:06 -0700, josh@joshtriplett.org wrote: > Lines starting with at least 8 spaces before a comment: > $ git grep -E '^ {8,}/\*' | wc -l > 1544 > > I think just about all of those are bugs. Maybe. Most of those are from Linus' first git commit. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-27 4:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <alpine.DEB.2.02.1409240745160.2051@localhost6.localdomain6>
2014-09-24 18:41 ` checkpatch: Does anyone care that comments are freeform aligned? Joe Perches
2014-09-26 23:03 ` [OPW kernel] " josh
2014-09-27 4:58 ` Joe Perches
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox