From: Julia Lawall Date: Sat, 7 Aug 2010 09:09:29 +0000 (+0200) Subject: UBI: eliminate update of list_for_each_entry loop cursor X-Git-Tag: v2.6.36-rc4~92^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ebc12f5f2e88a1c6a5436b71a506ac2bf66d6b;p=pandora-kernel.git UBI: eliminate update of list_for_each_entry loop cursor 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/) // @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 // Signed-off-by: Julia Lawall Signed-off-by: Artem Bityutskiy --- Reading git-diff-tree failed