public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Julia Lawall <julia@diku.dk>
Cc: linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
	David Woodhouse <dwmw2@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drivers/mtd/ubi: Eliminate update of
Date: Tue, 24 Aug 2010 12:52:12 +0000	[thread overview]
Message-ID: <1282654332.24044.170.camel@localhost> (raw)
In-Reply-To: <Pine.LNX.4.64.1008071109140.5821@ask.diku.dk>

On Sat, 2010-08-07 at 11:09 +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> list_for_each_entry uses its first argument to move from one element to the
> next, so modifying it can break the iteration.  The variable re1 is already
> used within the loop as a temporary variable, and is not live here.
> 
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r@
> iterator name list_for_each_entry;
> expression x,E;
> position p1,p2;
> @@
> 
> list_for_each_entry@p1(x,...) { <... x =@p2 E ...> }
> 
> @@
> expression x,E;
> position r.p1,r.p2;
> statement S;
> @@
> 
> *x =@p2 E
> ...
> list_for_each_entry@p1(x,...) S
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Pushed to ubi-2.6.git tree. This won't be seen in linux-next for some
time though, but I'll make it visible in linux-next at some point soon.

Thanks!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)


      parent reply	other threads:[~2010-08-24 12:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-07  9:09 [PATCH 2/2] drivers/mtd/ubi: Eliminate update of list_for_each_entry Julia Lawall
2010-08-08 10:25 ` [PATCH 2/2] drivers/mtd/ubi: Eliminate update of Artem Bityutskiy
2010-08-24 12:52 ` Artem Bityutskiy [this message]

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=1282654332.24044.170.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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