lkml.org 
[lkml]   [2010]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 3/3] fs/jffs2/dir.c: Use kmemdup
    From
    Date
    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/

    \
     
     \ /
      Last update: 2010-10-18 05:51    [W:0.025 / U:30.948 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site