[PATCH] staging: rtl8192e: remove casting of returned pointer from kmalloc

Jesper Juhl jj at chaosbits.net
Thu Sep 6 19:09:13 UTC 2012


On Wed, 5 Sep 2012, Devendra Naga wrote:

> as per Documentation/CodingStyle we dont need to cast the return of
> kmalloc
> 
> Signed-off-by: Devendra Naga <devendra.aaru at gmail.com>
> ---
>  drivers/staging/rtl8192e/rtllib_softmac.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
> index 7c95518..bc73c27 100644
> --- a/drivers/staging/rtl8192e/rtllib_softmac.c
> +++ b/drivers/staging/rtl8192e/rtllib_softmac.c
> @@ -3411,8 +3411,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
>  
>  		lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
>  
> -		new_crypt = (struct lib80211_crypt_data *)
> -			kmalloc(sizeof(*new_crypt), GFP_KERNEL);
> +		new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
>  		if (new_crypt == NULL) {
>  			ret = -ENOMEM;
>  			goto done;
> 

Looks correct to me.

Reviewed-by: Jesper Juhl <jj at chaosbits.net>


-- 
Jesper Juhl <jj at chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.




More information about the devel mailing list