linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Dave Jones <davej@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Andy Whitcroft <apw@shadowen.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] checkpatch: Test for kmalloc/memset(0) pairs
Date: Mon, 21 Mar 2011 14:55:14 +0100	[thread overview]
Message-ID: <20110321135513.GA6397@gere.osrc.amd.com> (raw)
In-Reply-To: <1300713980.16880.5813.camel@gandalf.stny.rr.com>

On Mon, Mar 21, 2011 at 09:26:20AM -0400, Steven Rostedt wrote:
> On Sat, 2011-03-19 at 15:39 -0400, Dave Jones wrote:
> 
> > Something that has crossed my mind over the last few days was the idea
> > of splitting checkpatch into two tools.
> > One for checking CodingStyle issues, and one for checking for actual
> > code problems like the memset example.
> > 
> > The motivation for such is that I think it's pretty clear that many maintainers
> > never run checkpatch on patches they queue up before pushing to Linus...
> > 
> > $ scripts/checkpatch.pl  ~/Mail/upstream/2.6.39/head-March-18-2011 | wc -l
> > 2361
> > 
> 
> I run it on all my patches. But there are some warnings that I ignore.
> Sometimes I don't split the 80char lines if doing so makes the code even
> uglier.

Same here, certain warnings checkpatch spits are plain dumb in certain
situations. What we want is to fix checkpatch to warn/error out only
on real issues which are valid 100% of the cases and stick all the
remaining, not-always-an-issue stuff which deserves a warning only
sometimes behind a "--pedantic" or "--extended-checks" option or
whatever.

> > The bulk of this is all "missing space here" "don't put a space there" type
> > fluff that most maintainers just don't care about.  Any valuable warnings
> > are lost in the noise.  If we had a separate tool to check for real flaws,
> > (or even a way to suppress the stylistic warnings from the existing one)
> > maybe more maintainers would run their changes through it.
> 
> As I replied with my phone, having a suppress warnings would be nice.
> 
> checkpatch -e patch
> 
> where -e is errors only?

Yeah, let's enable the errors-only checking by default, i.e. no args and if you
want additional ones, you need to switch on an option.

> > 
> > I dunno, maybe I'm just a crazy dreamer too, but I think many people
> > have written checkpatch off as useless in its current incarnation.
> 
> Well I and I'm sure Ingo use it quite a bit. I'm sure there are others
> that do too.

Yep, I have it as a pre-commit hook in git and it helps a lot. However,
sometimes I need to do '--no-verify' on false positives.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

  parent reply	other threads:[~2011-03-21 13:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18  2:52 [PATCH] checkpatch: Test for kmalloc/memset(0) pairs Steven Rostedt
2011-03-18  3:15 ` Jonathan Corbet
2011-03-18  3:32   ` Steven Rostedt
2011-03-20  3:40     ` Américo Wang
2011-03-20  7:02       ` Pekka Enberg
2011-03-20  8:01         ` Julia Lawall
2011-03-20  9:02           ` Pekka Enberg
2011-03-20  9:17             ` Julia Lawall
2011-03-20 10:54               ` Ingo Molnar
2011-03-20 11:06                 ` Pekka Enberg
2011-03-20 11:32                   ` Nicolas Palix
2011-03-20 12:00                     ` Julia Lawall
2011-03-20 11:09                 ` Alexey Dobriyan
2011-03-20 12:38                 ` Julia Lawall
2011-03-20 14:48                 ` Alejandro Riveira Fernández
2011-03-21 13:13                   ` Steven Rostedt
2011-03-24 15:34               ` Aneesh Kumar K. V
2011-03-24 16:08                 ` Julia Lawall
2011-03-24 16:10                   ` Nicolas Palix
2011-03-24 18:30                     ` Arnaud Lacombe
2011-03-24 20:39                       ` Julia Lawall
2011-03-24 17:28                   ` Aneesh Kumar K. V
2011-03-19 19:39   ` Dave Jones
2011-03-21 13:26     ` Steven Rostedt
2011-03-21 13:29       ` Steven Rostedt
2011-03-21 13:55       ` Borislav Petkov [this message]
2011-03-22 19:58       ` checkpatch: introduce --nocs to disable CodingStyle warnings Dave Jones
2011-03-22 20: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=20110321135513.GA6397@gere.osrc.amd.com \
    --to=bp@amd64.org \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=corbet@lwn.net \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).