Skip to contentSkip to conversation

staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c

PATCH In review Rebecca Mckeever 2 participants 5 messages Apr 3, 2022 – Apr 12, 2022 Staging

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 8b24330e97c1..da455eb4d8cb 100644
@@ -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
#4 lore raw

PATCH 3/3 staging: r8188eu: add blank line between functions

In reply to Rebecca Mckeever

Conform 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
index 2d316a6c8294..ecd0488c439b 100644
@@ -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
#2 lore raw

PATCH 2/3 staging: r8188eu: combine both sides of conditional statement

In reply to Rebecca Mckeever

Both 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
index da455eb4d8cb..2d316a6c8294 100644
@@ -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
Reviewed-by on v1 2/3
#3 lore raw

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.

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
index da455eb4d8cb..2d316a6c8294 100644
@@ -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