Skip to contentSkip to conversation

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

PATCH New Rebecca Mckeever 1 participant 3 messages Apr 5, 2022 Staging

lore
Share & tools
lore
#0 lore raw

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

These patches perform cleanup in functions rtw_survey_cmd_callback() and rtw_joinbss_cmd_callback().

Rebecca Mckeever (2):
staging: rtl8723bs: remove handlerOS independent comment
staging: rtl8723bs: combine both sides of conditional statement

 drivers/staging/rtl8723bs/core/rtw_cmd.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/2 staging: rtl8723bs: remove handlerOS independent comment

The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Additional instances found with git grep.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +0 -2
index 46e18a90529f..c16a2b644296 100644
@@ -1887,7 +1887,6 @@ void rtw_survey_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->scan_to_timer, 1);
 	} else if (pcmd->res != H2C_SUCCESS) {
 		_set_timer(&pmlmepriv->scan_to_timer, 1);
@@ -1918,7 +1917,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
#2 lore raw

PATCH 2/2 staging: rtl8723bs: combine both sides of conditional statement

In reply to Rebecca Mckeever

Both sides of conditional statement are the same except for the comment. Additional instances found with git grep.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +2 -6
index c16a2b644296..b4170f64d118 100644
@@ -1885,11 +1885,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 */
@@ -1915,11 +1913,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