All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Joe Perches <joe@perches.com>
Cc: "ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Sasha Levin <levinsasha928@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Ksummit-discuss] checkkpatch (in)sanity ?
Date: Mon, 29 Aug 2016 14:15:10 +0300	[thread overview]
Message-ID: <874m634yip.fsf@purkki.adurom.net> (raw)
In-Reply-To: <1472348579.26978.47.camel@perches.com> (Joe Perches's message of "Sat, 27 Aug 2016 18:42:59 -0700")

Joe Perches <joe@perches.com> writes:

> On Sat, 2016-08-27 at 21:06 -0400, Levin, Alexander wrote:
>> On Sat, Aug 27, 2016 at 04:40:52PM -0400, Joe Perches wrote:
>> > On Fri, Aug 26, 2016 at 01:26:35PM +0200, Greg KH wrote:
>> > > On Fri, Aug 26, 2016 at 12:46:51AM -0400, Levin, Alexander wrote:
>> > > > 
>> > > >     - Making checkpatch check for (some) of the stable kernel rules
>> > > >     (and possibly recommend adding the stable@ tag in certain cases?).
>> > > >       - Depends on: making checkpatch sane again
>> > > > >This sounds interesting.  What do you mean by "sane"?
>> > Sasha, can you expand your thoughts here please?
>> Sure. I have 2.5 concerns about the state of checkpatch:
> []
>> > Most all of the trivial spacing stuff can easily be
>> > ignored either by a human determining what's important
>> > or by using command line options like --ignore=spacing
>> 1.
>> This is the wrong default. By default checkpatch shouldn't be showing trivial
>> issues that encourage folks to try and work around them and as a result
>> produce worse code.
>> 
>> Look at the 80 character limit warning for example, what good does it do?
>
> That argument's been done several times. It keeps Linus happy.
> I don't care one way or another.
>
> I think the biggest issue is the seriousness that some people
> take checkpatch messages as dicta instead of ignorable bleats.

I wish that checkpatch would have a way to enable/disable warnings per
directory (or file). For example, there would be
drivers/net/wireless/ath/ath10k/.checkpatch which would disable the
warnings are not suitable for ath10k for one reason or another:

'MSLEEP',
'USLEEP_RANGE',
'PRINTK_WITHOUT_KERN_LEVEL',
'NETWORKING_BLOCK_COMMENT_STYLE',
'BLOCK_COMMENT_STYLE',
'LINUX_VERSION_CODE',
'COMPLEX_MACRO',
'PREFER_DEV_LEVEL',
'PREFER_PR_LEVEL',
'COMPARISON_TO_NULL',
'BIT_MACRO',
'CONSTANT_COMPARISON',
'MACRO_WITH_FLOW_CONTROL'

Currently my workaround is to have a custom ath10k-check script[1] which
runs checkpatch with those checks disabled. Oh, and it also filters out
some of the warnings based on the symbol it is located in.

https://github.com/qca/qca-swiss-army-knife/blob/master/tools/scripts/ath10k/ath10k-check

-- 
Kalle Valo

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@codeaurora.org>
To: Joe Perches <joe@perches.com>
Cc: "Levin\, Alexander" <alexander.levin@verizon.com>,
	Sasha Levin <levinsasha928@gmail.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"ksummit-discuss\@lists.linuxfoundation.org" 
	<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: checkkpatch (in)sanity ?
Date: Mon, 29 Aug 2016 14:15:10 +0300	[thread overview]
Message-ID: <874m634yip.fsf@purkki.adurom.net> (raw)
In-Reply-To: <1472348579.26978.47.camel@perches.com> (Joe Perches's message of "Sat, 27 Aug 2016 18:42:59 -0700")

Joe Perches <joe@perches.com> writes:

> On Sat, 2016-08-27 at 21:06 -0400, Levin, Alexander wrote:
>> On Sat, Aug 27, 2016 at 04:40:52PM -0400, Joe Perches wrote:
>> > On Fri, Aug 26, 2016 at 01:26:35PM +0200, Greg KH wrote:
>> > > On Fri, Aug 26, 2016 at 12:46:51AM -0400, Levin, Alexander wrote:
>> > > > 
>> > > >     - Making checkpatch check for (some) of the stable kernel rules
>> > > >     (and possibly recommend adding the stable@ tag in certain cases?).
>> > > >       - Depends on: making checkpatch sane again
>> > > > >This sounds interesting.  What do you mean by "sane"?
>> > Sasha, can you expand your thoughts here please?
>> Sure. I have 2.5 concerns about the state of checkpatch:
> []
>> > Most all of the trivial spacing stuff can easily be
>> > ignored either by a human determining what's important
>> > or by using command line options like --ignore=spacing
>> 1.
>> This is the wrong default. By default checkpatch shouldn't be showing trivial
>> issues that encourage folks to try and work around them and as a result
>> produce worse code.
>> 
>> Look at the 80 character limit warning for example, what good does it do?
>
> That argument's been done several times. It keeps Linus happy.
> I don't care one way or another.
>
> I think the biggest issue is the seriousness that some people
> take checkpatch messages as dicta instead of ignorable bleats.

I wish that checkpatch would have a way to enable/disable warnings per
directory (or file). For example, there would be
drivers/net/wireless/ath/ath10k/.checkpatch which would disable the
warnings are not suitable for ath10k for one reason or another:

'MSLEEP',
'USLEEP_RANGE',
'PRINTK_WITHOUT_KERN_LEVEL',
'NETWORKING_BLOCK_COMMENT_STYLE',
'BLOCK_COMMENT_STYLE',
'LINUX_VERSION_CODE',
'COMPLEX_MACRO',
'PREFER_DEV_LEVEL',
'PREFER_PR_LEVEL',
'COMPARISON_TO_NULL',
'BIT_MACRO',
'CONSTANT_COMPARISON',
'MACRO_WITH_FLOW_CONTROL'

Currently my workaround is to have a custom ath10k-check script[1] which
runs checkpatch with those checks disabled. Oh, and it also filters out
some of the warnings based on the symbol it is located in.

https://github.com/qca/qca-swiss-army-knife/blob/master/tools/scripts/ath10k/ath10k-check

-- 
Kalle Valo

  parent reply	other threads:[~2016-08-29 11:15 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27 20:40 [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches
2016-08-27 20:40 ` Joe Perches
2016-08-28  1:06 ` [Ksummit-discuss] " Levin, Alexander
2016-08-28  1:06   ` Levin, Alexander
2016-08-28  1:42   ` [Ksummit-discuss] " Joe Perches
2016-08-28  1:42     ` Joe Perches
2016-08-28  2:20     ` [Ksummit-discuss] " Joe Perches
2016-08-28  2:20       ` Joe Perches
2016-08-28  2:47     ` [Ksummit-discuss] " Levin, Alexander
2016-08-28  2:47       ` Levin, Alexander
2016-08-28 17:15       ` [Ksummit-discuss] " Joe Perches
2016-08-28 17:15         ` Joe Perches
2016-08-28 17:59         ` [Ksummit-discuss] " Greg KH
2016-08-28 17:59           ` Greg KH
2016-08-28 22:37         ` [Ksummit-discuss] " Levin, Alexander
2016-08-28 22:37           ` Levin, Alexander
2016-08-28 23:20           ` [Ksummit-discuss] " Joe Perches
2016-08-28 23:20             ` Joe Perches
2016-08-29  2:22             ` [Ksummit-discuss] " Levin, Alexander
2016-08-29  2:22               ` Levin, Alexander
2016-08-29  8:20               ` [Ksummit-discuss] " Christoph Hellwig
2016-08-29  8:20                 ` Christoph Hellwig
2016-08-29  7:15           ` [Ksummit-discuss] " Alexandre Belloni
2016-08-29  7:15             ` Alexandre Belloni
2016-08-29  9:01             ` Arnd Bergmann
2016-08-29  9:01               ` Arnd Bergmann
2016-08-29 12:47               ` Joe Perches
2016-08-29 12:47                 ` Joe Perches
2016-08-29 17:16                 ` Josh Triplett
2016-08-29 17:16                   ` Josh Triplett
2016-08-29 17:41                   ` Joe Perches
2016-08-29 17:41                     ` Joe Perches
2016-08-29 17:46         ` Luck, Tony
2016-08-29 17:46           ` Luck, Tony
2016-08-29 18:01           ` Joe Perches
2016-08-29 18:47             ` Joe Perches
2016-08-29 19:08             ` Josh Triplett
2016-08-29 19:08               ` Josh Triplett
2016-08-29 21:07             ` Arnd Bergmann
2016-08-29 21:07               ` Arnd Bergmann
2016-08-29 11:15     ` Kalle Valo [this message]
2016-08-29 11:15       ` Kalle Valo
2016-08-29 12:30       ` [Ksummit-discuss] " Joe Perches
2016-08-29 12:30         ` Joe Perches
2016-08-29 18:01         ` [Ksummit-discuss] " Kalle Valo
2016-08-29 18:01           ` Kalle Valo
2016-08-29 19:00           ` [Ksummit-discuss] " Joe Perches
2016-08-29 19:00             ` Joe Perches
2016-08-29 21:00           ` [Ksummit-discuss] " Arnd Bergmann
2016-08-29 21:00             ` Arnd Bergmann
2016-08-28  7:56   ` Alexey Dobriyan
2016-08-28  7:56     ` Alexey Dobriyan
2016-08-28  9:59     ` Julia Lawall
2016-08-28  9:59       ` Julia Lawall
2016-08-28 19:52       ` Joe Perches
2016-08-28 19:52         ` Joe Perches
2016-08-28 20:35         ` Jiri Kosina
2016-08-28 20:35           ` Jiri Kosina
2016-08-28 21:24         ` Dennis Kaarsemaker
2016-08-28 21:24           ` Dennis Kaarsemaker
2016-08-28 21:57           ` Joe Perches
2016-08-28 21:57             ` Joe Perches
2016-08-29 19:06 ` Dan Carpenter
2016-08-29 19:06   ` Dan Carpenter
2016-08-29 19:10   ` Josh Triplett
2016-08-29 19:10     ` Josh Triplett
2016-08-29 19:17     ` Dan Carpenter
2016-08-29 19:17       ` Dan Carpenter
2016-08-29 19:34       ` Joe Perches
2016-08-29 19:34         ` Joe Perches
2016-08-29 19:21     ` Joe Perches
2016-08-29 19:21       ` Joe Perches

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=874m634yip.fsf@purkki.adurom.net \
    --to=kvalo@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.