linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Julia Lawall <julia@diku.dk>
Cc: "Pekka Enberg" <penberg@kernel.org>,
	"Américo Wang" <xiyou.wangcong@gmail.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	LKML <linux-kernel@vger.kernel.org>,
	"Andy Whitcroft" <apw@shadowen.org>,
	"Dave Jones" <davej@redhat.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Nicolas Palix" <npalix@diku.dk>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] checkpatch: Test for kmalloc/memset(0) pairs
Date: Sun, 20 Mar 2011 11:54:12 +0100	[thread overview]
Message-ID: <20110320105412.GA11266@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.64.1103201007430.28495@ask.diku.dk>


* Julia Lawall <julia@diku.dk> wrote:

> On Sun, 20 Mar 2011, Pekka Enberg wrote:
> 
> > Hi Julia,
> > 
> > On Sun, Mar 20, 2011 at 10:01 AM, Julia Lawall <julia@diku.dk> wrote:
> > > Suggestions for how to make it easier to use or the documentation more
> > > understandable are welcome.
> > 
> > The benefit of scripts/checkpatch.pl is that it doesn't require any
> > setting up to do. I'm personally less likely to use Coccinelle (and
> > Sparse for that matter) on boxes where the software is not installed.
> > I'm not sure how other people feel about it, but I'd personally love
> > to see tools/coccinelle and tools/sparse.
> 
> This was discussed before, and it was felt that perhaps 75000 lines of 
> ocaml code was not really appropriate for the Linux source tree, [...]

We have drivers and rare architectures that have a (much) larger size and which 
are only useful to <0.01% of Linux users.

Coccinelle on the other hand is useful to 100% of Linux users.

We even have C++, perl and python code in the kernel repo so there's no 
language bigotry either - use the language that works best for your project.

> [...] and also that it would too much complicate our development process.

'our' as in the Linux kernel development process? I really don't think it's an 
issue - see above.

or 'our' as in Coccinelle development process? When we brought tools/perf/ into 
the kernel repo all it forced on us were sane Git commits and a predictable, 
(modulo-) 3 months release/stabilization cycle. Both constraints served the 
quality of the perf project very well - but of course your milage may vary.

> One reason for using multiple machines would be to work on multiple 
> architectures.  But Coccinelle is not sensitive to the architecture on 
> which it is run, so perhaps you do't need to have it installed everywhere.

I think the point Pekka tried to make is to have it integrated into the kbuild 
mechanism as well at a certain point. That way it's very easy to use it and we 
maintainers could require frequent patch submitters to use those tools to check 
the quality of their patches. Right now i cannot require that, as it's not part 
of the kernel repo. Requiring a checkpatch.pl check is much easier, as it's 
available to everyone who is writing kernel patches.

'The power of the default' is a very strong force.

Also, IIRC Thomas also sometimes uses Coccinelle to generate *patches*, so 
having it in the kernel would also help that kind of usage.

> > File "/home/penberg/src/linux/scripts/coccinelle/api/memdup_user.cocci",
> > line 32, column 5,  charpos = 747
> >     around = '<+...', whole content = -    <+... when != goto l2;
> > Fatal error: exception Lexer_cocci.Lexical("invalid in a nonempty
> > context: <+...")
> > make[1]: *** [mm/slub.o] Error 1
> > make: *** [mm/slub.o] Error 2
> > 
> > penberg@jaguar:~/src/linux$ dpkg -l|grep coccinelle
> > ii  coccinelle                                      0.2.2.deb-2
> >                                         semantic patching tool for C
> > 
> > [ I'm on Ubuntu 10.10. ]
> 
> Indeed that one seems to be quite out of date.  You can get the most 
> recent version here: https://launchpad.net/~npalix/+archive/coccinelle

With tools/coccinelle/ you would never run into such problems of distributing 
the latest stable version to your fellow kernel developers: it would always be 
available in tools/coccinelle/.

Integration, synergy, availability, distribution and half a dozen other 
buzzwords come to mind as to why it's a good idea to have kernel-focused
tools hosted in the kernel repo :-)

IMO it's an option to consider.

Thanks,

	Ingo

  reply	other threads:[~2011-03-20 10:54 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 [this message]
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
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=20110320105412.GA11266@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=corbet@lwn.net \
    --cc=davej@redhat.com \
    --cc=julia@diku.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npalix@diku.dk \
    --cc=penberg@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=xiyou.wangcong@gmail.com \
    /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).