mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Fabian Frederick <fabf@skynet.be>, Joe Perches <joe@perches.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] [PATCH V3] scripts/coccinelle/free: Delete NULL test before freeing functions?
Date: Sat, 28 Jun 2014 23:28:42 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1406282326010.2022@localhost6.localdomain6> (raw)
In-Reply-To: <53AF2CE6.5020300@users.sourceforge.net>

On Sat, 28 Jun 2014, SF Markus Elfring wrote:

> > Sorry but I'm not working on coccinelle ; just did a small script for kernel tree.
> 
> I would appreciate a more constructive feedback for my update suggestions around
> the topic "Deletion of unnecessary checks before specific function calls".
> - Did you look at the concrete patches?
> - How do you think about the general approach?
> 
> Examples:
> https://systeme.lip6.fr/pipermail/cocci/2014-March/000676.html
> http://marc.info/?l=kernel-janitors&m=139405971927100&w=2

Regular expressions do not allow taking advantage of the optimizations 
provided by Coccinelle and are not easy for a reader to understand.

> https://systeme.lip6.fr/pipermail/cocci/2014-March/000677.html
> http://marc.info/?l=kernel-janitors&m=139405983727148&w=2

This is not safe due to the use of when any.  You have no guarantee that 
there is not a dereference of input in the matched region, or that the 
value of input is still the argument value at the point of the test.

julia

  reply	other threads:[~2014-06-28 21:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-28  8:47 [PATCH V3] scripts/coccinelle/free: add NULL test before freeing functions Fabian Frederick
2014-06-28  9:08 ` [PATCH V3] scripts/coccinelle/free: Delete NULL test before freeing functions? SF Markus Elfring
2014-06-28 10:00   ` Fabian Frederick
2014-06-28 11:38     ` SF Markus Elfring
2014-06-28 12:01       ` Fabian Frederick
2014-06-28 21:00         ` SF Markus Elfring
2014-06-28 21:28           ` Julia Lawall [this message]
2014-06-29 10:45             ` [Cocci] " SF Markus Elfring
2014-06-29  8:27           ` Fabian Frederick
2014-06-29 11:00             ` SF Markus Elfring
2014-06-28 18:32   ` [Cocci] " Julia Lawall
2014-06-28 17:55 ` [PATCH V3] scripts/coccinelle/free: add NULL test before freeing functions Julia Lawall
2014-06-28 17:58   ` Julia Lawall

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=alpine.DEB.2.02.1406282326010.2022@localhost6.localdomain6 \
    --to=julia.lawall@lip6.fr \
    --cc=akpm@linux-foundation.org \
    --cc=cocci@systeme.lip6.fr \
    --cc=elfring@users.sourceforge.net \
    --cc=fabf@skynet.be \
    --cc=joe@perches.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®