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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 S;
> @@
> 
> -  to = \(kmalloc\|kzalloc\)(size,flag);
> +  to = kmemdup(from,size,flag);
>    if (to==NULL || ...) S
> -  memcpy(to, from, size);
> 
> Signed-off-by: Shreeya Patel <shreeya.patel23498@xxxxxxxxx>
> ---
>  drivers/staging/lustre/lnet/lnet/api-ni.c | 5 ++---

Always work off of the latest kernel tree.  Ideally linux-next or the
staging.git staging-next tree.  Worse case, Linus's tree.  But never off
of an old kernel tree, that will only cause you to duplicate work that
others have done :(

Please resync against 4.18-rc1 and see why I say this when trying to
apply your patch...

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux