[S390] drivers/s390/char: Use kmemdup
authorJulia Lawall <julia@diku.dk>
Mon, 17 May 2010 08:00:23 +0000 (10:00 +0200)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Mon, 17 May 2010 08:00:18 +0000 (10:00 +0200)
commit939e379e9e183ae6291ac7caa4a5e1dfadae4ccc
tree959e2c54ca203d6ffef74687bc9371f0c86cccda
parent777a5510093a6d6443351160c6969a0e66f3ba8a
[S390] drivers/s390/char: Use kmemdup

Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/keyboard.c