staging: r8188eu: cleanup of style and typos
cover staging: r8188eu: cleanup of style and typos
These patches address style issues and typos found by checkpatch or suggested by Dan Carpenter or Larry Finger.
Rebecca Mckeever (4):
staging: r8188eu: format comments in drivers/net style
staging: r8188eu: remove extra 'the'
staging: r8188eu: correct misspelling in comment 'tppe' -> 'type'
staging: r8188eu: use sizeof(*pvar) for allocating structs
drivers/staging/r8188eu/core/rtw_cmd.c | 81 +++++++++++++------------- 1 file changed, 39 insertions(+), 42 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/4 staging: r8188eu: format comments in drivers/net style
Format comments according to the Linux kernerl coding style for drivers/net so they do not need to be reformatted after this driver is accepted into the drivers/net tree.
--- drivers/staging/r8188eu/core/rtw_cmd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/r8188eu/core/rtw_cmd.c +3 -6
@@ -11,8 +11,7 @@#include "../include/rtw_mlme_ext.h" #include "../include/rtl8188e_dm.h" -/* -* Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. +/* Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. * No irqsave is necessary. */
@@ -96,8 +95,7 @@ static void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) } } -/* -* Calling Context: +/* Calling Context: * * rtw_enqueue_cmd can only be called between kernel thread, * since only spin_lock is used.
@@ -317,8 +315,7 @@ int rtw_cmd_thread(void *context)return 0 ; } -/* -* rtw_sitesurvey_cmd(~) +/* rtw_sitesurvey_cmd(~) * ### NOTE:#### (!!!!) * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock */
Signature · 1 line
2.32.0
PATCH 2/4 staging: r8188eu: remove extra 'the'
In reply to Rebecca MckeeverRemove repeated 'the' in comment to be grammatically correct and conform to Linux kernel coding style.
Found with checkpatch:
WARNING: Possible repeated word: 'the'
--- drivers/staging/r8188eu/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_cmd.c +1 -1
@@ -519,7 +519,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) psecnetwork->IELength =0 ;/* Added by Albert 2009/02/18 */ -/* If the the driver wants to use the bssid to create the connection. */ +/* If the driver wants to use the bssid to create the connection. */ /* If not, we have to copy the connecting AP's MAC address to it so that */ /* the driver just has the bssid information for PMKIDList searching. */
Signature · 1 line
2.32.0
Re: [PATCH 2/4] staging: r8188eu: remove extra 'the'
Quoted 16 lines · Rebecca Mckeever
Remove repeated 'the' in comment to be grammatically correct and conform to Linux kernel coding style.
Found with checkpatch:
WARNING: Possible repeated word: 'the'Signed-off-by Rebecca Mckeever <[email protected]>--- drivers/staging/r8188eu/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/r8188eu/core/rtw_cmd.c +0
-0
drivers/staging/r8188eu/core/rtw_cmd.c u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) · line 521
Quoted 3 lines
drivers/staging/r8188eu/core/rtw_cmd.c +0
-0@@ -519,7 +519,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) psecnetwork->IELength =0 ;/* Added by Albert 2009/02/18 */
I don't know if this type of thing "Added by Albert" is sprinkled through the file, but it seems they can be removed. Git will keep history of this file from here on. (And in case anyone asks what happened to Albert's notations, they can find that in the git history too ;))
Quoted 9 lines
drivers/staging/r8188eu/core/rtw_cmd.c +1
-1-/* If the the driver wants to use the bssid to create the connection. */ +/* If the driver wants to use the bssid to create the connection. */ /* If not, we have to copy the connecting AP's MAC address to it so that */ /* the driver just has the bssid information for PMKIDList searching. */ Signature · 1 line
2.32.0
PATCH 3/4 staging: r8188eu: correct misspelling in comment 'tppe' -> 'type'
In reply to Rebecca MckeeverCorrect spelling typo.
--- drivers/staging/r8188eu/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/core/rtw_cmd.c +1 -1
@@ -1162,7 +1162,7 @@ u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType) } pdrvextra_cmd_parm->ec_id =P2P_PROTO_WK_CID ; - pdrvextra_cmd_parm->type_size = intCmdType;/* As the command tppe. */ + pdrvextra_cmd_parm->type_size = intCmdType;/* As the command type. */ pdrvextra_cmd_parm->pbuf =NULL ;/* Must be NULL here */ init_h2fwcmd_w_parm_no_rsp (ph2c, pdrvextra_cmd_parm,GEN_CMD_CODE (_Set_Drv_Extra));
Signature · 1 line
2.32.0
Re: [PATCH 3/4] staging: r8188eu: correct misspelling in comment 'tppe' -> 'type'
Quoted 13 lines · Rebecca Mckeever
Correct spelling typo.
Suggested-by Dan Carpenter <[email protected]>Signed-off-by Rebecca Mckeever <[email protected]>--- drivers/staging/r8188eu/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/r8188eu/core/rtw_cmd.c +0
-0
drivers/staging/r8188eu/core/rtw_cmd.c u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType) · line 1165
Quoted 5 lines
drivers/staging/r8188eu/core/rtw_cmd.c +1
-1@@ -1162,7 +1162,7 @@ u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType) } pdrvextra_cmd_parm->ec_id =P2P_PROTO_WK_CID ; - pdrvextra_cmd_parm->type_size = intCmdType;/* As the command tppe. */ + pdrvextra_cmd_parm->type_size = intCmdType;/* As the command type. */
Nothing to do with this patch. Just saw intCmdType. Suggest another patch to fix this mixed case function parameter. Maybe cmd_type instead?
Quoted 3 lines
drivers/staging/r8188eu/core/rtw_cmd.c +0
-0pdrvextra_cmd_parm->pbuf =NULL ;/* Must be NULL here */ init_h2fwcmd_w_parm_no_rsp (ph2c, pdrvextra_cmd_parm,GEN_CMD_CODE (_Set_Drv_Extra));
PATCH 4/4 staging: r8188eu: use sizeof(*pvar) for allocating structs
In reply to Rebecca MckeeverUse sizeof(*pvar) instead of sizeof(struct var) when allocating memory. This conforms to Linux kernel coding style, improves readability, and decreases the opportunity for bugs if the pointer variable type is changed. Issue found by checkpatch messages of the following format:
CHECK: Prefer kzalloc(sizeof(*pvar)...) over kzalloc(sizeof(struct var)...)
--- drivers/staging/r8188eu/core/rtw_cmd.c | 68 +++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-)
drivers/staging/r8188eu/core/rtw_cmd.c +34 -34
@@ -334,11 +334,11 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,if (check_fwstate (pmlmepriv, _FW_LINKED))p2p_ps_wk_cmd (padapter,P2P_PS_SCAN ,1 ); - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c)return _FAIL; - psurveyPara =kzalloc (sizeof (struct sitesurvey_parm ),GFP_ATOMIC ); + psurveyPara =kzalloc (sizeof (*psurveyPara),GFP_ATOMIC );if (!psurveyPara) {kfree (ph2c);return _FAIL;
@@ -399,13 +399,13 @@ u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pbsetdataratepara =kzalloc (sizeof (struct setdatarate_parm ),GFP_ATOMIC ); + pbsetdataratepara =kzalloc (sizeof (*pbsetdataratepara),GFP_ATOMIC );if (!pbsetdataratepara) {kfree (ph2c); res = _FAIL;
@@ -438,7 +438,7 @@ u8 rtw_createbss_cmd(struct adapter *padapter)rtw_led_control (padapter,LED_CTL_START_TO_LINK ); - pcmd =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + pcmd =kzalloc (sizeof (*pcmd),GFP_ATOMIC );if (!pcmd) { res = _FAIL; goto exit;
@@ -475,7 +475,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)rtw_led_control (padapter,LED_CTL_START_TO_LINK ); - pcmd =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + pcmd =kzalloc (sizeof (*pcmd),GFP_ATOMIC );if (!pcmd) { res = _FAIL; goto exit;
@@ -624,12 +624,12 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra nstruct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (*ph2c),GFP_KERNEL );if (!ph2c) { res = false; goto exit; } - psetop =kzalloc (sizeof (struct setopmode_parm ),GFP_KERNEL ); + psetop =kzalloc (sizeof (*psetop),GFP_KERNEL );if (!psetop) {kfree (ph2c);
@@ -659,20 +659,20 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key)struct sta_info *sta = (struct sta_info *)psta;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (*ph2c),GFP_KERNEL );if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para =kzalloc (sizeof (struct set_stakey_parm ),GFP_KERNEL ); + psetstakey_para =kzalloc (sizeof (*psetstakey_para),GFP_KERNEL );if (!psetstakey_para) {kfree (ph2c); res = _FAIL; goto exit; } - psetstakey_rsp =kzalloc (sizeof (struct set_stakey_rsp ),GFP_KERNEL ); + psetstakey_rsp =kzalloc (sizeof (*psetstakey_rsp),GFP_KERNEL );if (!psetstakey_rsp) {kfree (ph2c);kfree (psetstakey_para);
@@ -718,13 +718,13 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue)if (!enqueue) {clear_cam_entry (padapter, entry); }else { - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para =kzalloc (sizeof (struct set_stakey_parm ), + psetstakey_para =kzalloc (sizeof (*psetstakey_para),GFP_ATOMIC );if (!psetstakey_para) {kfree (ph2c);
@@ -732,7 +732,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) goto exit; } - psetstakey_rsp =kzalloc (sizeof (struct set_stakey_rsp ), + psetstakey_rsp =kzalloc (sizeof (*psetstakey_rsp),GFP_ATOMIC );if (!psetstakey_rsp) {kfree (ph2c);
@@ -765,13 +765,13 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)struct addBaReq_parm *paddbareq_parm;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - paddbareq_parm =kzalloc (sizeof (struct addBaReq_parm ),GFP_ATOMIC ); + paddbareq_parm =kzalloc (sizeof (*paddbareq_parm),GFP_ATOMIC );if (!paddbareq_parm) {kfree (ph2c); res = _FAIL;
@@ -798,13 +798,13 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;
@@ -839,7 +839,7 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan) }/* prepare cmd parameter */ - setChannelPlan_param =kzalloc (sizeof (struct SetChannelPlan_param ), + setChannelPlan_param =kzalloc (sizeof (*setChannelPlan_param),GFP_KERNEL );if (!setChannelPlan_param) { res = _FAIL;
@@ -848,7 +848,7 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan) setChannelPlan_param->channel_plan = chplan;/* need enqueue, prepare cmd_obj and enqueue */ - pcmdobj =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + pcmdobj =kzalloc (sizeof (*pcmdobj),GFP_KERNEL );if (!pcmdobj) {kfree (setChannelPlan_param); res = _FAIL;
@@ -1010,13 +1010,13 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue)/* return res; */ if (enqueue) { - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ), + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c);
@@ -1056,13 +1056,13 @@ u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 min_time)u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ), + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c);
@@ -1109,13 +1109,13 @@ u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue)return res;if (enqueue) { - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (*ph2c),GFP_KERNEL );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ), + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_KERNEL );if (!pdrvextra_cmd_parm) {kfree (ph2c);
@@ -1148,13 +1148,13 @@ u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType)if (rtw_p2p_chk_state (pwdinfo,P2P_STATE_NONE ))return res; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;
@@ -1182,13 +1182,13 @@ u8 rtw_ps_cmd(struct adapter *padapter)u8 res = _SUCCESS; - ppscmd =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ppscmd =kzalloc (sizeof (*ppscmd),GFP_ATOMIC );if (!ppscmd) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ppscmd); res = _FAIL;
@@ -1253,13 +1253,13 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;
@@ -1284,13 +1284,13 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;
Signature · 1 line
2.32.0
Re: [PATCH 4/4] staging: r8188eu: use sizeof(*pvar) for allocating structs
Quoted 8 lines · Rebecca Mckeever
Use
sizeof(*pvar)instead of sizeof(struct var) when allocating memory. This conforms to Linux kernel coding style, improves readability, and decreases the opportunity for bugs if the pointer variable type is changed. Issue found by checkpatch messages of the following format:CHECK: Prefer kzalloc(sizeof(*pvar)...) over kzalloc(sizeof(struct var)...)
Signed-off-by Rebecca Mckeever <[email protected]>
Quoted 285 lines
--- drivers/staging/r8188eu/core/rtw_cmd.c | 68 +++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-)drivers/staging/r8188eu/core/rtw_cmd.c +34
-34@@ -334,11 +334,11 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,if (check_fwstate (pmlmepriv, _FW_LINKED))p2p_ps_wk_cmd (padapter,P2P_PS_SCAN ,1 ); - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c)return _FAIL; - psurveyPara =kzalloc (sizeof (struct sitesurvey_parm ),GFP_ATOMIC ); + psurveyPara =kzalloc (sizeof (*psurveyPara),GFP_ATOMIC );if (!psurveyPara) {kfree (ph2c);return _FAIL;@@ -399,13 +399,13 @@ u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pbsetdataratepara =kzalloc (sizeof (struct setdatarate_parm ),GFP_ATOMIC ); + pbsetdataratepara =kzalloc (sizeof (*pbsetdataratepara),GFP_ATOMIC );if (!pbsetdataratepara) {kfree (ph2c); res = _FAIL;@@ -438,7 +438,7 @@ u8 rtw_createbss_cmd(struct adapter *padapter)rtw_led_control (padapter,LED_CTL_START_TO_LINK ); - pcmd =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + pcmd =kzalloc (sizeof (*pcmd),GFP_ATOMIC );if (!pcmd) { res = _FAIL; goto exit;@@ -475,7 +475,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)rtw_led_control (padapter,LED_CTL_START_TO_LINK ); - pcmd =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + pcmd =kzalloc (sizeof (*pcmd),GFP_ATOMIC );if (!pcmd) { res = _FAIL; goto exit;@@ -624,12 +624,12 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra nstruct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (*ph2c),GFP_KERNEL );if (!ph2c) { res = false; goto exit; } - psetop =kzalloc (sizeof (struct setopmode_parm ),GFP_KERNEL ); + psetop =kzalloc (sizeof (*psetop),GFP_KERNEL );if (!psetop) {kfree (ph2c);@@ -659,20 +659,20 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key)struct sta_info *sta = (struct sta_info *)psta;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (*ph2c),GFP_KERNEL );if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para =kzalloc (sizeof (struct set_stakey_parm ),GFP_KERNEL ); + psetstakey_para =kzalloc (sizeof (*psetstakey_para),GFP_KERNEL );if (!psetstakey_para) {kfree (ph2c); res = _FAIL; goto exit; } - psetstakey_rsp =kzalloc (sizeof (struct set_stakey_rsp ),GFP_KERNEL ); + psetstakey_rsp =kzalloc (sizeof (*psetstakey_rsp),GFP_KERNEL );if (!psetstakey_rsp) {kfree (ph2c);kfree (psetstakey_para);@@ -718,13 +718,13 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue)if (!enqueue) {clear_cam_entry (padapter, entry); }else { - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - psetstakey_para =kzalloc (sizeof (struct set_stakey_parm ), + psetstakey_para =kzalloc (sizeof (*psetstakey_para),GFP_ATOMIC );if (!psetstakey_para) {kfree (ph2c);@@ -732,7 +732,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue) goto exit; } - psetstakey_rsp =kzalloc (sizeof (struct set_stakey_rsp ), + psetstakey_rsp =kzalloc (sizeof (*psetstakey_rsp),GFP_ATOMIC );if (!psetstakey_rsp) {kfree (ph2c);@@ -765,13 +765,13 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)struct addBaReq_parm *paddbareq_parm;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - paddbareq_parm =kzalloc (sizeof (struct addBaReq_parm ),GFP_ATOMIC ); + paddbareq_parm =kzalloc (sizeof (*paddbareq_parm),GFP_ATOMIC );if (!paddbareq_parm) {kfree (ph2c); res = _FAIL;@@ -798,13 +798,13 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;@@ -839,7 +839,7 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan) }/* prepare cmd parameter */ - setChannelPlan_param =kzalloc (sizeof (struct SetChannelPlan_param ), + setChannelPlan_param =kzalloc (sizeof (*setChannelPlan_param),GFP_KERNEL );if (!setChannelPlan_param) { res = _FAIL;@@ -848,7 +848,7 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan) setChannelPlan_param->channel_plan = chplan;/* need enqueue, prepare cmd_obj and enqueue */ - pcmdobj =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + pcmdobj =kzalloc (sizeof (*pcmdobj),GFP_KERNEL );if (!pcmdobj) {kfree (setChannelPlan_param); res = _FAIL;@@ -1010,13 +1010,13 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue)/* return res; */ if (enqueue) { - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ), + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c);@@ -1056,13 +1056,13 @@ u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 min_time)u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ), + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c);@@ -1109,13 +1109,13 @@ u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue)return res;if (enqueue) { - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (*ph2c),GFP_KERNEL );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ), + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_KERNEL );if (!pdrvextra_cmd_parm) {kfree (ph2c);@@ -1148,13 +1148,13 @@ u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType)if (rtw_p2p_chk_state (pwdinfo,P2P_STATE_NONE ))return res; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;@@ -1182,13 +1182,13 @@ u8 rtw_ps_cmd(struct adapter *padapter)u8 res = _SUCCESS; - ppscmd =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ppscmd =kzalloc (sizeof (*ppscmd),GFP_ATOMIC );if (!ppscmd) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ppscmd); res = _FAIL;@@ -1253,13 +1253,13 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;@@ -1284,13 +1284,13 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt)struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC ); + ph2c =kzalloc (sizeof (*ph2c),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - pdrvextra_cmd_parm =kzalloc (sizeof (struct drvextra_cmd_parm ),GFP_ATOMIC ); + pdrvextra_cmd_parm =kzalloc (sizeof (*pdrvextra_cmd_parm),GFP_ATOMIC );if (!pdrvextra_cmd_parm) {kfree (ph2c); res = _FAIL;Signature · 1 line
2.32.0