Re: [PATCH 09/12] staging: ks7010: remove unnecessary cast

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

 



On Tue, Mar 14, 2017 at 09:54:07AM +1100, Tobin C. Harding wrote:
> Return value from kmalloc() does not require a cast.
> 
> Remove unnecessary cast.
> 
> Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
> ---
>  drivers/staging/ks7010/ks_wlan_net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 1451ba7..e1e4a31 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -2561,7 +2561,7 @@ static int ks_wlan_data_write(struct net_device *dev,
>  	if (priv->sleep_mode == SLP_SLEEP)
>  		return -EPERM;
>  	/* for SLEEP MODE */
> -	wbuff = (unsigned char *)kmalloc(dwrq->length, GFP_ATOMIC);
> +	wbuff = kmalloc(dwrq->length, GFP_ATOMIC);
>  	if (!wbuff)
>  		return -EFAULT;

This should also return -ENOMEM, but that's a separate fix :)

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