linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: remove unnecessary braces in if statements
       [not found] <20220218043705.GA23783.ref@snoopy>
@ 2022-02-18  4:37 ` Marcelo Aloisio da Silva
  2022-02-18 11:44   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Marcelo Aloisio da Silva @ 2022-02-18  4:37 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter, Greg Kroah-Hartman
  Cc: linux-staging, linux-kernel

Braces are not necessary for single statement blocks.

Signed-off-by: Marcelo Aloisio da Silva <marcelo.as@aol.com>
---
 drivers/staging/r8188eu/core/rtw_mlme.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 45eff3018d73..ad1d73a27548 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -1379,10 +1379,8 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
 	if (pregistrypriv->wifi_spec == 1) {
 		struct wifidirect_info *pwdinfo = &adapter->wdinfo;
 		if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
-		{
 			/* auto site survey */
 			rtw_auto_scan_handler(adapter);
-		}
 	}
 
 	rcu_read_lock();
@@ -1392,14 +1390,12 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
 		/*  expire NAT2.5 entry */
 		nat25_db_expire(adapter);
 
-		if (adapter->pppoe_connection_in_progress > 0) {
+		if (adapter->pppoe_connection_in_progress > 0)
 			adapter->pppoe_connection_in_progress--;
-		}
 
 		/*  due to rtw_dynamic_check_timer_handlder() is called every 2 seconds */
-		if (adapter->pppoe_connection_in_progress > 0) {
+		if (adapter->pppoe_connection_in_progress > 0)
 			adapter->pppoe_connection_in_progress--;
-		}
 	}
 
 	rcu_read_unlock();
-- 
2.25.1


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

* Re: [PATCH] staging: r8188eu: remove unnecessary braces in if statements
  2022-02-18  4:37 ` [PATCH] staging: r8188eu: remove unnecessary braces in if statements Marcelo Aloisio da Silva
@ 2022-02-18 11:44   ` Dan Carpenter
  2022-02-18 12:50     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2022-02-18 11:44 UTC (permalink / raw)
  To: Marcelo Aloisio da Silva
  Cc: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging,
	linux-kernel

On Fri, Feb 18, 2022 at 01:37:05AM -0300, Marcelo Aloisio da Silva wrote:
> Braces are not necessary for single statement blocks.
> 
> Signed-off-by: Marcelo Aloisio da Silva <marcelo.as@aol.com>
> ---
>  drivers/staging/r8188eu/core/rtw_mlme.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
> index 45eff3018d73..ad1d73a27548 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme.c
> @@ -1379,10 +1379,8 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
>  	if (pregistrypriv->wifi_spec == 1) {
>  		struct wifidirect_info *pwdinfo = &adapter->wdinfo;
>  		if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
> -		{
>  			/* auto site survey */
>  			rtw_auto_scan_handler(adapter);
> -		}

Generally we prefer if statements around multi-line indents.  It helps
for readability.  But you could move them to the right place in a
different patch.

 		if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
 			/* auto site survey */
 			rtw_auto_scan_handler(adapter);
		}

The rest of the patch is fine.

regards,
dan carpenter


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

* Re: [PATCH] staging: r8188eu: remove unnecessary braces in if statements
  2022-02-18 11:44   ` Dan Carpenter
@ 2022-02-18 12:50     ` Dan Carpenter
  2022-02-20 17:31       ` Marcelo Aloisio da Silva
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2022-02-18 12:50 UTC (permalink / raw)
  To: Marcelo Aloisio da Silva
  Cc: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging,
	linux-kernel

On Fri, Feb 18, 2022 at 02:44:55PM +0300, Dan Carpenter wrote:
> On Fri, Feb 18, 2022 at 01:37:05AM -0300, Marcelo Aloisio da Silva wrote:
> > Braces are not necessary for single statement blocks.
> > 
> > Signed-off-by: Marcelo Aloisio da Silva <marcelo.as@aol.com>
> > ---
> >  drivers/staging/r8188eu/core/rtw_mlme.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
> > index 45eff3018d73..ad1d73a27548 100644
> > --- a/drivers/staging/r8188eu/core/rtw_mlme.c
> > +++ b/drivers/staging/r8188eu/core/rtw_mlme.c
> > @@ -1379,10 +1379,8 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
> >  	if (pregistrypriv->wifi_spec == 1) {
> >  		struct wifidirect_info *pwdinfo = &adapter->wdinfo;
> >  		if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
> > -		{
> >  			/* auto site survey */
> >  			rtw_auto_scan_handler(adapter);
> > -		}
> 
> Generally we prefer if statements around multi-line indents.  It helps

I meant "prefer curly braces around multi-line indents".

regards,
dan carpenter


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

* Re: [PATCH] staging: r8188eu: remove unnecessary braces in if statements
  2022-02-18 12:50     ` Dan Carpenter
@ 2022-02-20 17:31       ` Marcelo Aloisio da Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Marcelo Aloisio da Silva @ 2022-02-20 17:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Larry Finger, Phillip Potter, Greg Kroah-Hartman, linux-staging,
	linux-kernel

On Fri, Feb 18, 2022 at 03:50:58PM +0300, Dan Carpenter wrote:
> On Fri, Feb 18, 2022 at 02:44:55PM +0300, Dan Carpenter wrote:
> > On Fri, Feb 18, 2022 at 01:37:05AM -0300, Marcelo Aloisio da Silva wrote:
> > > Braces are not necessary for single statement blocks.
> > > 
> > > Signed-off-by: Marcelo Aloisio da Silva <marcelo.as@aol.com>
> > > ---
> > >  drivers/staging/r8188eu/core/rtw_mlme.c | 8 ++------
> > >  1 file changed, 2 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
> > > index 45eff3018d73..ad1d73a27548 100644
> > > --- a/drivers/staging/r8188eu/core/rtw_mlme.c
> > > +++ b/drivers/staging/r8188eu/core/rtw_mlme.c
> > > @@ -1379,10 +1379,8 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
> > >  	if (pregistrypriv->wifi_spec == 1) {
> > >  		struct wifidirect_info *pwdinfo = &adapter->wdinfo;
> > >  		if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
> > > -		{
> > >  			/* auto site survey */
> > >  			rtw_auto_scan_handler(adapter);
> > > -		}
> > 
> > Generally we prefer if statements around multi-line indents.  It helps
> 
> I meant "prefer curly braces around multi-line indents".
> 
> regards,
> dan carpenter
> 
Thanks Dan for the feedback.
I'll fix the brace for this if statement in another patch.

Regards,
Marcelo

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

end of thread, other threads:[~2022-02-20 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220218043705.GA23783.ref@snoopy>
2022-02-18  4:37 ` [PATCH] staging: r8188eu: remove unnecessary braces in if statements Marcelo Aloisio da Silva
2022-02-18 11:44   ` Dan Carpenter
2022-02-18 12:50     ` Dan Carpenter
2022-02-20 17:31       ` Marcelo Aloisio da Silva

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