staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c
cover staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c
These patches perform cleanup in/around functions rtw_survey_cmd_callback() and rtw_joinbss_cmd_callback().
Rebecca Mckeever (3):
staging: r8188eu: remove handlerOS independent comment
staging: r8188eu: combine both sides of conditional statement
staging: r8188eu: add blank line between functions
drivers/staging/r8188eu/core/rtw_cmd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/3 staging: r8188eu: remove handlerOS independent comment
The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Additional instance found with git grep.
--- drivers/staging/r8188eu/core/rtw_cmd.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/r8188eu/core/rtw_cmd.c +0 -1
@@ -1447,7 +1447,6 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)if (pcmd->res ==H2C_DROPPED ) {/* TODO: cancel timer and do timeout handler directly... */ -/* need to make timeout handlerOS independent */ _set_timer (&pmlmepriv->assoc_timer,1 ); }else if (pcmd->res !=H2C_SUCCESS ) {_set_timer (&pmlmepriv->assoc_timer,1 );
Signature · 1 line
2.32.0
PATCH 2/3 staging: r8188eu: combine both sides of conditional statement
In reply to Rebecca MckeeverBoth sides of conditional statement are the same except for the comment. Additional instance found with git grep.
--- drivers/staging/r8188eu/core/rtw_cmd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/r8188eu/core/rtw_cmd.c +2 -6
@@ -1411,11 +1411,9 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if (pcmd->res ==H2C_DROPPED ) { +if (pcmd->res !=H2C_SUCCESS ) {/* TODO: cancel timer and do timeout handler directly... */ _set_timer (&pmlmepriv->scan_to_timer,1 ); - }else if (pcmd->res !=H2C_SUCCESS ) { -_set_timer (&pmlmepriv->scan_to_timer,1 ); }/* free cmd */
@@ -1445,11 +1443,9 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if (pcmd->res ==H2C_DROPPED ) { +if (pcmd->res !=H2C_SUCCESS ) {/* TODO: cancel timer and do timeout handler directly... */ _set_timer (&pmlmepriv->assoc_timer,1 ); - }else if (pcmd->res !=H2C_SUCCESS ) { -_set_timer (&pmlmepriv->assoc_timer,1 ); }rtw_free_cmd_obj (pcmd);
Signature · 1 line
2.32.0
Re: [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement
Quoted 5 lines · Rebecca Mckeever
Both sides of conditional statement are the same except for the comment. Additional instance found with git grep.
Suggested-by Dan Carpenter <[email protected]>Signed-off-by Rebecca Mckeever <[email protected]>
Quoted 37 lines
--- drivers/staging/r8188eu/core/rtw_cmd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/staging/r8188eu/core/rtw_cmd.c +2
-6@@ -1411,11 +1411,9 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if (pcmd->res ==H2C_DROPPED ) { +if (pcmd->res !=H2C_SUCCESS ) {/* TODO: cancel timer and do timeout handler directly... */ _set_timer (&pmlmepriv->scan_to_timer,1 ); - }else if (pcmd->res !=H2C_SUCCESS ) { -_set_timer (&pmlmepriv->scan_to_timer,1 ); }/* free cmd */ @@ -1445,11 +1443,9 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -if (pcmd->res ==H2C_DROPPED ) { +if (pcmd->res !=H2C_SUCCESS ) {/* TODO: cancel timer and do timeout handler directly... */ _set_timer (&pmlmepriv->assoc_timer,1 ); - }else if (pcmd->res !=H2C_SUCCESS ) { -_set_timer (&pmlmepriv->assoc_timer,1 ); }rtw_free_cmd_obj (pcmd);Signature · 1 line
2.32.0
PATCH 3/3 staging: r8188eu: add blank line between functions
In reply to Rebecca MckeeverConform to Linux kernel coding style.
Noticed when completing a different patch.
--- drivers/staging/r8188eu/core/rtw_cmd.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/r8188eu/core/rtw_cmd.c +1 -0
@@ -1420,6 +1420,7 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)rtw_free_cmd_obj (pcmd); } +void rtw_disassoc_cmd_callback (struct adapter *padapter,struct cmd_obj *pcmd) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
Signature · 1 line
2.32.0