diff mbox

[OPW,kernel] Staging:rtl8821ae: Drop memory allocation cast for kmalloc in hal_btc.c

Message ID 20140308145409.GA11241@winterfell
State New, archived
Headers show

Commit Message

Iulia Manda March 8, 2014, 2:54 p.m. UTC
Remove unnecessary cast for kmalloc, after running alloc_cast.cocci semantic patch.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
---
 drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sarah Sharp March 8, 2014, 9:31 p.m. UTC | #1
On Sat, Mar 08, 2014 at 04:54:09PM +0200, Iulia Manda wrote:
> Remove unnecessary cast for kmalloc, after running alloc_cast.cocci semantic patch.
> 
> Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>

Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>

Still needs a space between the [PATCH] and the rest of the subject,
but the git tools will do fine applying it.

> ---
>  drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
> index 6898868..7b1d113 100644
> --- a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
> +++ b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
> @@ -2025,7 +2025,7 @@ void rtl_8821ae_c2h_command_handle(struct ieee80211_hw *hw)
>  		rtl_write_byte(rtlpriv, 0x1AF, 0x00);
>  		return;
>  	}
> -	ptmp_buf = (u8 *) kmalloc(c2h_event.cmd_len, GFP_KERNEL);
> +	ptmp_buf = kmalloc(c2h_event.cmd_len, GFP_KERNEL);
>  	if(ptmp_buf == NULL) {
>  		RT_TRACE(COMP_FW, DBG_TRACE, ("malloc cmd buf failed\n"));
>  		return;
> -- 
> 1.7.10.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Julia Lawall March 8, 2014, 10:03 p.m. UTC | #2
On Sat, 8 Mar 2014, Iulia Manda wrote:

> Remove unnecessary cast for kmalloc, after running alloc_cast.cocci 
> semantic patch.

There is nothing called alloc_cast.cocci in the Linux kernel.  I guess you 
got it from the Coccinelle web site or from coccinellery.org?  In that 
case, it would be good to include the semantic patch in your commit 
message.

julia

> 
> Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
> ---
>  drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
> index 6898868..7b1d113 100644
> --- a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
> +++ b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
> @@ -2025,7 +2025,7 @@ void rtl_8821ae_c2h_command_handle(struct ieee80211_hw *hw)
>  		rtl_write_byte(rtlpriv, 0x1AF, 0x00);
>  		return;
>  	}
> -	ptmp_buf = (u8 *) kmalloc(c2h_event.cmd_len, GFP_KERNEL);
> +	ptmp_buf = kmalloc(c2h_event.cmd_len, GFP_KERNEL);
>  	if(ptmp_buf == NULL) {
>  		RT_TRACE(COMP_FW, DBG_TRACE, ("malloc cmd buf failed\n"));
>  		return;
> -- 
> 1.7.10.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
diff mbox

Patch

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
index 6898868..7b1d113 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hal_btc.c
@@ -2025,7 +2025,7 @@  void rtl_8821ae_c2h_command_handle(struct ieee80211_hw *hw)
 		rtl_write_byte(rtlpriv, 0x1AF, 0x00);
 		return;
 	}
-	ptmp_buf = (u8 *) kmalloc(c2h_event.cmd_len, GFP_KERNEL);
+	ptmp_buf = kmalloc(c2h_event.cmd_len, GFP_KERNEL);
 	if(ptmp_buf == NULL) {
 		RT_TRACE(COMP_FW, DBG_TRACE, ("malloc cmd buf failed\n"));
 		return;