Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332990 > unrolled thread

[PATCH v3 3/5] Staging: rtl8188eu/core: Coding style fix, set constant operand on right in tests

Started byColin Vidal <colin@cvidal.org>
First post2016-02-12 19:10 +0100
Last post2016-02-12 19:10 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 3/5] Staging: rtl8188eu/core: Coding style fix, set constant operand on right in tests Colin Vidal <colin@cvidal.org> - 2016-02-12 19:10 +0100
    [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable Colin Vidal <colin@cvidal.org> - 2016-02-12 19:10 +0100
      Re: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 01:40 +0100
        Re: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable Colin Vidal <colin@cvidal.org> - 2016-02-15 17:30 +0100
    [PATCH v3 4/5] Staging: rtl8188eu/core: Coding style fix, avoid line over 80 characters Colin Vidal <colin@cvidal.org> - 2016-02-12 19:10 +0100

#1332990 — [PATCH v3 3/5] Staging: rtl8188eu/core: Coding style fix, set constant operand on right in tests

FromColin Vidal <colin@cvidal.org>
Date2016-02-12 19:10 +0100
Subject[PATCH v3 3/5] Staging: rtl8188eu/core: Coding style fix, set constant operand on right in tests
Message-ID<r1qkj-24n-25@gated-at.bofh.it>
Signed-off-by: Colin Vidal <colin@cvidal.org>
---
 drivers/staging/rtl8188eu/core/rtw_iol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c b/drivers/staging/rtl8188eu/core/rtw_iol.c
index 7642c22..3dd1a9a 100644
--- a/drivers/staging/rtl8188eu/core/rtw_iol.c
+++ b/drivers/staging/rtl8188eu/core/rtw_iol.c
@@ -18,10 +18,10 @@
 
 bool rtw_IOL_applied(struct adapter *adapter)
 {
-	if (1 == adapter->registrypriv.fw_iol)
+	if (adapter->registrypriv.fw_iol == 1)
 		return true;
 
-	if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
+	if ((adapter->registrypriv.fw_iol == 2) && (!adapter_to_dvobj(adapter)->ishighspeed))
 		return true;
 	return false;
 }
-- 
2.5.0

[toc] | [next] | [standalone]


#1332993 — [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable

FromColin Vidal <colin@cvidal.org>
Date2016-02-12 19:10 +0100
Subject[PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable
Message-ID<r1qkk-24n-37@gated-at.bofh.it>
In reply to#1332990
Signed-off-by: Colin Vidal <colin@cvidal.org>
---
 drivers/staging/rtl8188eu/core/rtw_iol.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c b/drivers/staging/rtl8188eu/core/rtw_iol.c
index 2e2145c..ba6c492 100644
--- a/drivers/staging/rtl8188eu/core/rtw_iol.c
+++ b/drivers/staging/rtl8188eu/core/rtw_iol.c
@@ -18,11 +18,7 @@
 
 bool rtw_IOL_applied(struct adapter *adapter)
 {
-	if (adapter->registrypriv.fw_iol == 1)
-		return true;
-
-	if ((adapter->registrypriv.fw_iol == 2) &&
-	    (!adapter_to_dvobj(adapter)->ishighspeed))
-		return true;
-	return false;
+	return adapter->registrypriv.fw_iol == 1 ||
+		(adapter->registrypriv.fw_iol == 2 &&
+		 !adapter_to_dvobj(adapter)->ishighspeed);
 }
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1334042 — Re: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-02-15 01:40 +0100
SubjectRe: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable
Message-ID<r2fmQ-1Of-57@gated-at.bofh.it>
In reply to#1332993
On Fri, Feb 12, 2016 at 07:05:53PM +0100, Colin Vidal wrote:
> Signed-off-by: Colin Vidal <colin@cvidal.org>
> ---
>  drivers/staging/rtl8188eu/core/rtw_iol.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c b/drivers/staging/rtl8188eu/core/rtw_iol.c
> index 2e2145c..ba6c492 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_iol.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_iol.c
> @@ -18,11 +18,7 @@
>  
>  bool rtw_IOL_applied(struct adapter *adapter)
>  {
> -	if (adapter->registrypriv.fw_iol == 1)
> -		return true;
> -
> -	if ((adapter->registrypriv.fw_iol == 2) &&
> -	    (!adapter_to_dvobj(adapter)->ishighspeed))
> -		return true;
> -	return false;
> +	return adapter->registrypriv.fw_iol == 1 ||
> +		(adapter->registrypriv.fw_iol == 2 &&
> +		 !adapter_to_dvobj(adapter)->ishighspeed);
>  }

I'm sorry, but this patch does not do what you said it does, it's much
harder to read now :(

Also, I can't take a patch without a changelog text :(

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1334578 — Re: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable

FromColin Vidal <colin@cvidal.org>
Date2016-02-15 17:30 +0100
SubjectRe: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable
Message-ID<r2ucb-3qG-51@gated-at.bofh.it>
In reply to#1334042
On Sun, 2016-02-14 at 16:39 -0800, Greg Kroah-Hartman wrote:
> On Fri, Feb 12, 2016 at 07:05:53PM +0100, Colin Vidal wrote:
> > Signed-off-by: Colin Vidal <colin@cvidal.org>
> > ---
> >  drivers/staging/rtl8188eu/core/rtw_iol.c | 10 +++-------
> >  1 file changed, 3 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c
> > b/drivers/staging/rtl8188eu/core/rtw_iol.c
> > index 2e2145c..ba6c492 100644
> > --- a/drivers/staging/rtl8188eu/core/rtw_iol.c
> > +++ b/drivers/staging/rtl8188eu/core/rtw_iol.c
> > @@ -18,11 +18,7 @@
> >  
> >  bool rtw_IOL_applied(struct adapter *adapter)
> >  {
> > -	if (adapter->registrypriv.fw_iol == 1)
> > -		return true;
> > -
> > -	if ((adapter->registrypriv.fw_iol == 2) &&
> > -	    (!adapter_to_dvobj(adapter)->ishighspeed))
> > -		return true;
> > -	return false;
> > +	return adapter->registrypriv.fw_iol == 1 ||
> > +		(adapter->registrypriv.fw_iol == 2 &&
> > +		 !adapter_to_dvobj(adapter)->ishighspeed);
> >  }
> 
> I'm sorry, but this patch does not do what you said it does, it's
> much
> harder to read now :(
> 
> Also, I can't take a patch without a changelog text :(
> 
> thanks,
> 
> greg k-h

Hi Greg,

Thanks for you replie!

OK, I thought it was a better idea (as suggests Joe Perches) to group
the test in a way to avoid multiples - and maybe confusing - returns.
So, I'll remove this one.

Sorry about the changelot, I missed it while making patch series, I'll
resend it.

Thanks,

Colin

[toc] | [prev] | [next] | [standalone]


#1332995 — [PATCH v3 4/5] Staging: rtl8188eu/core: Coding style fix, avoid line over 80 characters

FromColin Vidal <colin@cvidal.org>
Date2016-02-12 19:10 +0100
Subject[PATCH v3 4/5] Staging: rtl8188eu/core: Coding style fix, avoid line over 80 characters
Message-ID<r1qkk-24n-39@gated-at.bofh.it>
In reply to#1332990
Signed-off-by: Colin Vidal <colin@cvidal.org>
---
 drivers/staging/rtl8188eu/core/rtw_iol.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c b/drivers/staging/rtl8188eu/core/rtw_iol.c
index 3dd1a9a..2e2145c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_iol.c
+++ b/drivers/staging/rtl8188eu/core/rtw_iol.c
@@ -21,7 +21,8 @@ bool rtw_IOL_applied(struct adapter *adapter)
 	if (adapter->registrypriv.fw_iol == 1)
 		return true;
 
-	if ((adapter->registrypriv.fw_iol == 2) && (!adapter_to_dvobj(adapter)->ishighspeed))
+	if ((adapter->registrypriv.fw_iol == 2) &&
+	    (!adapter_to_dvobj(adapter)->ishighspeed))
 		return true;
 	return false;
 }
-- 
2.5.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web