Re: [PATCH] staging: cxt1e1: use kzalloc instead of kmalloc/memset 0

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

 



On 2014-03-05 at 03:37:15 +0100, Daeseok Youn <daeseok.youn@xxxxxxxxx> wrote:
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@xxxxxxxxx>
> ---
>  drivers/staging/cxt1e1/sbecom_inline_linux.h |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/cxt1e1/sbecom_inline_linux.h b/drivers/staging/cxt1e1/sbecom_inline_linux.h
> index ba3ff3e..6dd1b55 100644
> --- a/drivers/staging/cxt1e1/sbecom_inline_linux.h
> +++ b/drivers/staging/cxt1e1/sbecom_inline_linux.h
> @@ -46,11 +46,9 @@ void        pci_write_32 (u_int32_t *p, u_int32_t v);
>  static inline void *
>  OS_kmalloc (size_t size)
>  {
> -    char       *ptr = kmalloc (size, GFP_KERNEL | GFP_DMA);
> +	char *ptr = kzalloc(size, GFP_KERNEL | GFP_DMA);
>  
> -    if (ptr)
> -        memset (ptr, 0, size);
> -    return ptr;
> +	return ptr;
>  }

It would probably be even better to get rid of this function altogether
and replace all calls to it by kmalloc/kzalloc.

>From a quick look at the users of OS_kmalloc, it also looks like GFP_DMA
isn't needed for all of them.

Cheers
Tobias
_______________________________________________
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