linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c
@ 2022-04-03 19:17 Rebecca Mckeever
  2022-04-03 19:17 ` [PATCH 1/3] staging: r8188eu: remove handlerOS independent comment Rebecca Mckeever
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rebecca Mckeever @ 2022-04-03 19:17 UTC (permalink / raw)
  To: outreachy
  Cc: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging,
	linux-kernel, Rebecca Mckeever

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

-- 
2.32.0


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

* [PATCH 1/3] staging: r8188eu: remove handlerOS independent comment
  2022-04-03 19:17 [PATCH 0/3] staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
@ 2022-04-03 19:17 ` Rebecca Mckeever
  2022-04-03 19:17 ` [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement Rebecca Mckeever
  2022-04-03 19:17 ` [PATCH 3/3] staging: r8188eu: add blank line between functions Rebecca Mckeever
  2 siblings, 0 replies; 5+ messages in thread
From: Rebecca Mckeever @ 2022-04-03 19:17 UTC (permalink / raw)
  To: outreachy
  Cc: Larry Finger, Phillip Potter, 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 instance found with git grep.

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

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 8b24330e97c1..da455eb4d8cb 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -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);
-- 
2.32.0


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

* [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement
  2022-04-03 19:17 [PATCH 0/3] staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
  2022-04-03 19:17 ` [PATCH 1/3] staging: r8188eu: remove handlerOS independent comment Rebecca Mckeever
@ 2022-04-03 19:17 ` Rebecca Mckeever
  2022-04-12 23:36   ` Ira Weiny
  2022-04-03 19:17 ` [PATCH 3/3] staging: r8188eu: add blank line between functions Rebecca Mckeever
  2 siblings, 1 reply; 5+ messages in thread
From: Rebecca Mckeever @ 2022-04-03 19:17 UTC (permalink / raw)
  To: outreachy
  Cc: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging,
	linux-kernel, Rebecca Mckeever, Dan Carpenter

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

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

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index da455eb4d8cb..2d316a6c8294 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -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);
-- 
2.32.0


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

* [PATCH 3/3] staging: r8188eu: add blank line between functions
  2022-04-03 19:17 [PATCH 0/3] staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
  2022-04-03 19:17 ` [PATCH 1/3] staging: r8188eu: remove handlerOS independent comment Rebecca Mckeever
  2022-04-03 19:17 ` [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement Rebecca Mckeever
@ 2022-04-03 19:17 ` Rebecca Mckeever
  2 siblings, 0 replies; 5+ messages in thread
From: Rebecca Mckeever @ 2022-04-03 19:17 UTC (permalink / raw)
  To: outreachy
  Cc: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging,
	linux-kernel, Rebecca Mckeever

Conform to Linux kernel coding style.
Noticed when completing a different patch.

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_cmd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 2d316a6c8294..ecd0488c439b 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -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;
-- 
2.32.0


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

* Re: [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement
  2022-04-03 19:17 ` [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement Rebecca Mckeever
@ 2022-04-12 23:36   ` Ira Weiny
  0 siblings, 0 replies; 5+ messages in thread
From: Ira Weiny @ 2022-04-12 23:36 UTC (permalink / raw)
  To: Rebecca Mckeever
  Cc: outreachy, Larry Finger, Phillip Potter, Greg Kroah-Hartman,
	linux-staging, linux-kernel, Dan Carpenter

On Sun, Apr 03, 2022 at 02:17:05PM -0500, Rebecca Mckeever wrote:
> Both sides of conditional statement are the same except for the comment.
> Additional instance found with git grep.
> 
> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/staging/r8188eu/core/rtw_cmd.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
> index da455eb4d8cb..2d316a6c8294 100644
> --- a/drivers/staging/r8188eu/core/rtw_cmd.c
> +++ b/drivers/staging/r8188eu/core/rtw_cmd.c
> @@ -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);
> -- 
> 2.32.0
> 

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

end of thread, other threads:[~2022-04-12 23:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-03 19:17 [PATCH 0/3] staging: r8188eu: clean up two *_cmd_callback() functions in rtw_cmd.c Rebecca Mckeever
2022-04-03 19:17 ` [PATCH 1/3] staging: r8188eu: remove handlerOS independent comment Rebecca Mckeever
2022-04-03 19:17 ` [PATCH 2/3] staging: r8188eu: combine both sides of conditional statement Rebecca Mckeever
2022-04-12 23:36   ` Ira Weiny
2022-04-03 19:17 ` [PATCH 3/3] staging: r8188eu: add blank line between functions 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).