Re: [PATCH] Staging: lustre: Use kmemdup() instead of kzalloc and memcpy

2018-06-17 Thread Greg KH
On Sun, Jun 17, 2018 at 04:46:55PM +0530, Shreeya Patel wrote: > Replace calls to kzalloc or kmalloc followed by a memcpy with > a direct call to kmemdup to shorten the code. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement

[PATCH] Staging: lustre: Use kmemdup() instead of kzalloc and memcpy

2018-06-17 Thread Shreeya Patel
Replace calls to kzalloc or kmalloc followed by a memcpy with a direct call to kmemdup to shorten the code. The Coccinelle semantic patch used to make this change is as follows: @@ expression from,to,size,flag; statement S; @@ - to = \(kmalloc\|kzalloc\)(size,flag); + to = kmemdup(from,size,fla