Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1471796

Re: checkkpatch (in)sanity ?

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: checkkpatch (in)sanity ?
Date 2016-08-29 14:40 +0200
Message-ID <sbu14-7js-41@gated-at.bofh.it> (permalink)
References <saSI9-NY-9@gated-at.bofh.it> <saWLL-3rM-1@gated-at.bofh.it> <saXot-3E9-3@gated-at.bofh.it> <sbsLD-6Cn-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-08-29 at 14:15 +0300, Kalle Valo wrote:
> 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

Hey Kalle:

I looked at your script (which also does compilation
and sparse checking) I don't see how a .checkpatch_conf
hierarchy helps you much there as you've added all those
long symbol name long line avoidance bits.

Also, there'd be a lot of rework to the globals in
checkpatch for per-directory specific overrides if someone
fed it files in multiple directories like

checkpatch.pl <patchfile touching lib/kernel/include>

A couple btw's:

Why avoid the printk, sleep or macro tests?

And this for ath10k_core_register_work:

    ('ath10k_core_register_work', 'RETURN_VOID'),

and the code associated to it:

err:
	/* TODO: It's probably a good idea to release device from the driver
	 * but calling device_release_driver() here will cause a deadlock.
	 */
	return;
}

ia avoided a few times in the kernel by using a bare ";"
instead of "return;" before the function closing brace.

It's maybe unfortunate that gcc / c spec doesn't allow
jumping to a label just before the function close brace.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-27 22:50 +0200
  Re: checkkpatch (in)sanity ? "Levin, Alexander" <alexander.levin@verizon.com> - 2016-08-28 03:10 +0200
    Re: checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-28 03:50 +0200
      Re: checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-28 04:30 +0200
      Re: checkkpatch (in)sanity ? "Levin, Alexander" <alexander.levin@verizon.com> - 2016-08-28 04:50 +0200
        Re: checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-28 19:20 +0200
          Re: checkkpatch (in)sanity ? Greg KH <gregkh@linuxfoundation.org> - 2016-08-28 20:00 +0200
          Re: checkkpatch (in)sanity ? "Levin, Alexander" <alexander.levin@verizon.com> - 2016-08-29 00:40 +0200
            Re: checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 01:30 +0200
              Re: checkkpatch (in)sanity ? "Levin, Alexander" <alexander.levin@verizon.com> - 2016-08-29 04:30 +0200
                Re: checkkpatch (in)sanity ? Christoph Hellwig <hch@infradead.org> - 2016-08-29 10:30 +0200
            Re: [Ksummit-discuss] checkkpatch (in)sanity ? Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-08-29 09:20 +0200
              Re: [Ksummit-discuss] checkkpatch (in)sanity ? Arnd Bergmann <arnd@arndb.de> - 2016-08-29 11:10 +0200
                Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 14:50 +0200
                Re: [Ksummit-discuss] checkkpatch (in)sanity ? Josh Triplett <josh@joshtriplett.org> - 2016-08-29 19:20 +0200
                Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 19:50 +0200
          RE: [Ksummit-discuss] checkkpatch (in)sanity ? "Luck, Tony" <tony.luck@intel.com> - 2016-08-29 19:50 +0200
            Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 20:10 +0200
              Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 20:50 +0200
              Re: [Ksummit-discuss] checkkpatch (in)sanity ? Josh Triplett <josh@joshtriplett.org> - 2016-08-29 21:10 +0200
              Re: [Ksummit-discuss] checkkpatch (in)sanity ? Arnd Bergmann <arnd@arndb.de> - 2016-08-29 23:10 +0200
      Re: checkkpatch (in)sanity ? Kalle Valo <kvalo@codeaurora.org> - 2016-08-29 13:20 +0200
        Re: checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 14:40 +0200
          Re: checkkpatch (in)sanity ? Kalle Valo <kvalo@codeaurora.org> - 2016-08-29 20:10 +0200
            Re: checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 21:10 +0200
            Re: [Ksummit-discuss] checkkpatch (in)sanity ? Arnd Bergmann <arnd@arndb.de> - 2016-08-29 23:10 +0200
    Re: [Ksummit-discuss] checkkpatch (in)sanity ? Alexey Dobriyan <adobriyan@gmail.com> - 2016-08-28 10:00 +0200
      Re: [Ksummit-discuss] checkkpatch (in)sanity ? Julia Lawall <julia.lawall@lip6.fr> - 2016-08-28 12:00 +0200
        Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-28 22:00 +0200
          Re: [Ksummit-discuss] checkkpatch (in)sanity ? Jiri Kosina <jikos@kernel.org> - 2016-08-28 22:40 +0200
          Re: [Ksummit-discuss] checkkpatch (in)sanity ? Dennis Kaarsemaker <dennis@kaarsemaker.net> - 2016-08-28 23:30 +0200
            Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 00:00 +0200
  Re: [Ksummit-discuss] checkkpatch (in)sanity ? Dan Carpenter <dan.carpenter@oracle.com> - 2016-08-29 21:10 +0200
    Re: [Ksummit-discuss] checkkpatch (in)sanity ? Dan Carpenter <dan.carpenter@oracle.com> - 2016-08-29 21:20 +0200
      Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 21:40 +0200
    Re: [Ksummit-discuss] checkkpatch (in)sanity ? Josh Triplett <josh@joshtriplett.org> - 2016-08-29 21:20 +0200
      Re: [Ksummit-discuss] checkkpatch (in)sanity ? Joe Perches <joe@perches.com> - 2016-08-29 21:30 +0200

csiph-web