staging: rtl8723au: Remove redundant casting in rtw_mlme_ext.c
authorSachin Kamat <sachin.kamat@linaro.org>
Thu, 29 May 2014 11:35:18 +0000 (17:05 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:09:48 +0000 (14:09 -0700)
Casting value returned by kzalloc is useless.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c

index 0d52699..84ca06b 100644 (file)
@@ -4873,8 +4873,7 @@ void report_survey_event23a(struct rtw_adapter *padapter,
        pmlmeext = &padapter->mlmeextpriv;
        pcmdpriv = &padapter->cmdpriv;
 
-       pcmd_obj = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj),
-                                            GFP_ATOMIC);
+       pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
        if (!pcmd_obj)
                return;
 
@@ -4925,8 +4924,7 @@ void report_surveydone_event23a(struct rtw_adapter *padapter)
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
-       pcmd_obj = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj),
-                                            GFP_ATOMIC);
+       pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
        if (!pcmd_obj)
                return;
 
@@ -4970,8 +4968,7 @@ void report_join_res23a(struct rtw_adapter *padapter, int res)
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
-       pcmd_obj = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj),
-                                            GFP_ATOMIC);
+       pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
        if (!pcmd_obj)
                return;
 
@@ -5021,8 +5018,7 @@ void report_del_sta_event23a(struct rtw_adapter *padapter,
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
-       pcmd_obj = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj),
-                                            GFP_ATOMIC);
+       pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
        if (!pcmd_obj)
                return;
 
@@ -5076,8 +5072,7 @@ void report_add_sta_event23a(struct rtw_adapter *padapter,
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 
-       pcmd_obj = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj),
-                                            GFP_ATOMIC);
+       pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
        if (!pcmd_obj)
                return;
 
@@ -5493,13 +5488,12 @@ static void survey_timer_hdl(unsigned long data)
                        pmlmeext->scan_abort = false;/* reset */
                }
 
-               ph2c = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj),
-                       GFP_ATOMIC);
+               ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
                if (!ph2c)
                        goto exit_survey_timer_hdl;
 
-               psurveyPara = (struct sitesurvey_parm*)
-                       kzalloc(sizeof(struct sitesurvey_parm), GFP_ATOMIC);
+               psurveyPara = kzalloc(sizeof(struct sitesurvey_parm),
+                                       GFP_ATOMIC);
                if (!psurveyPara) {
                        kfree(ph2c);
                        goto exit_survey_timer_hdl;
@@ -6173,14 +6167,13 @@ int set_tx_beacon_cmd23a(struct rtw_adapter* padapter)
        u8 res = _SUCCESS;
        int len_diff = 0;
 
-       ph2c = (struct cmd_obj *)kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
+       ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
        if (!ph2c) {
                res = _FAIL;
                goto exit;
        }
 
-       ptxBeacon_parm = (struct Tx_Beacon_param *)
-               kzalloc(sizeof(struct Tx_Beacon_param), GFP_ATOMIC);
+       ptxBeacon_parm = kzalloc(sizeof(struct Tx_Beacon_param), GFP_ATOMIC);
        if (!ptxBeacon_parm) {
                kfree(ph2c);
                res = _FAIL;