linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: rtl8723bs: clean up two *_cmd_callback() functions in rtw_cmd.c
@ 2022-04-05  1:10 Rebecca Mckeever
  2022-04-05  1:10 ` [PATCH 1/2] staging: rtl8723bs: remove handlerOS independent comment Rebecca Mckeever
  2022-04-05  1:10 ` [PATCH 2/2] staging: rtl8723bs: combine both sides of conditional statement Rebecca Mckeever
  0 siblings, 2 replies; 3+ messages in thread
From: Rebecca Mckeever @ 2022-04-05  1:10 UTC (permalink / raw)
  To: outreachy
  Cc: Greg Kroah-Hartman, linux-staging, linux-kernel, Rebecca Mckeever

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(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] staging: rtl8723bs: remove handlerOS independent comment
  2022-04-05  1:10 [PATCH 0/2] staging: rtl8723bs: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
@ 2022-04-05  1:10 ` Rebecca Mckeever
  2022-04-05  1:10 ` [PATCH 2/2] staging: rtl8723bs: combine both sides of conditional statement Rebecca Mckeever
  1 sibling, 0 replies; 3+ messages in thread
From: Rebecca Mckeever @ 2022-04-05  1:10 UTC (permalink / raw)
  To: outreachy
  Cc: Greg Kroah-Hartman, linux-staging, linux-kernel, Rebecca Mckeever,
	Dan Carpenter

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

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index 46e18a90529f..c16a2b644296 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -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);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] staging: rtl8723bs: combine both sides of conditional statement
  2022-04-05  1:10 [PATCH 0/2] staging: rtl8723bs: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
  2022-04-05  1:10 ` [PATCH 1/2] staging: rtl8723bs: remove handlerOS independent comment Rebecca Mckeever
@ 2022-04-05  1:10 ` Rebecca Mckeever
  1 sibling, 0 replies; 3+ messages in thread
From: Rebecca Mckeever @ 2022-04-05  1:10 UTC (permalink / raw)
  To: outreachy
  Cc: Greg Kroah-Hartman, linux-staging, linux-kernel, Rebecca Mckeever,
	Dan Carpenter

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

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index c16a2b644296..b4170f64d118 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -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);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-05  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-05  1:10 [PATCH 0/2] staging: rtl8723bs: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
2022-04-05  1:10 ` [PATCH 1/2] staging: rtl8723bs: remove handlerOS independent comment Rebecca Mckeever
2022-04-05  1:10 ` [PATCH 2/2] staging: rtl8723bs: combine both sides of conditional statement Rebecca Mckeever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).