Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-27 Thread David Miller
From: Amitoj Kaur Chawla Date: Thu, 23 Jun 2016 10:19:37 +0530 > Replace calls to kmalloc followed by a memcpy with a direct call to > kmemdup. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement S; >

Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-27 Thread David Miller
From: Amitoj Kaur Chawla Date: Thu, 23 Jun 2016 10:19:37 +0530 > Replace calls to kmalloc followed by a memcpy with a direct call to > kmemdup. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement S; > @@ > > - to =

Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-27 Thread Ying Xue
On 06/23/2016 12:49 PM, Amitoj Kaur Chawla wrote: > Replace calls to kmalloc followed by a memcpy with a direct call to > kmemdup. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement S; > @@ > > - to =

Re: [PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-27 Thread Ying Xue
On 06/23/2016 12:49 PM, Amitoj Kaur Chawla wrote: > Replace calls to kmalloc followed by a memcpy with a direct call to > kmemdup. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression from,to,size,flag; > statement S; > @@ > > - to =

[PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-22 Thread Amitoj Kaur Chawla
Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. 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,flag); if (to==NULL || ...) S

[PATCH] tipc: Use kmemdup instead of kmalloc and memcpy

2016-06-22 Thread Amitoj Kaur Chawla
Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. 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,flag); if (to==NULL || ...) S