Messages in this thread | | | Subject | Re: [PATCH 3/3] fs/jffs2/dir.c: Use kmemdup | From | Artem Bityutskiy <> | Date | Mon, 18 Oct 2010 06:43:34 +0300 |
| |
On Sun, 2010-10-17 at 21:56 +0200, Julia Lawall wrote: > Convert a sequence of kmalloc and memcpy to use kmemdup. > > The semantic patch that performs this transformation is: > (http://coccinelle.lip6.fr/) > > // <smpl> > @@ > expression a,flag,len; > expression arg,e1,e2; > statement S; > @@ > > a = > - \(kmalloc\|kzalloc\)(len,flag) > + kmemdup(arg,len,flag) > <... when != a > if (a == NULL || ...) S > ...> > - memcpy(a,arg,len+1); > // </smpl> > > Signed-off-by: Julia Lawall <julia@diku.dk> > > --- > fs/jffs2/dir.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-)
Picked this one and put to l2-mtd-2.6.git, thanks.
-- Best Regards, Artem Bityutskiy (Артём Битюцкий)
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |