[dpdk-dev,v3,2/4] net/bnx2x: correct unmeetable comparison

Message ID 152627427362.53058.5993339273922161219.stgit@localhost.localdomain (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Andy Green May 14, 2018, 5:04 a.m. UTC
  /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:
In function ‘elink_check_kr2_wa’:
/home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:12922:28:
error: bitwise comparison always evaluates to false
[-Werror=tautological-compare]
        ((next_page & 0xe0) == 0x2))));

This was fixed elsewhere in 2014

Signed-off-by: Andy Green <andy@warmcat.com>
Fixes: b5bf7719221d ("bnx2x: driver support routines")
Cc: stable@dpdk.org
---
 drivers/net/bnx2x/elink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit May 14, 2018, 11:17 a.m. UTC | #1
On 5/14/2018 6:04 AM, Andy Green wrote:
> /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:
> In function ‘elink_check_kr2_wa’:
> /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:12922:28:
> error: bitwise comparison always evaluates to false
> [-Werror=tautological-compare]
>         ((next_page & 0xe0) == 0x2))));
> 
> This was fixed elsewhere in 2014

To be able to apply this fix in dpdk I think we need maintainers ack on this
change, they are cc'ed.

> 
> Signed-off-by: Andy Green <andy@warmcat.com>
> Fixes: b5bf7719221d ("bnx2x: driver support routines")
> Cc: stable@dpdk.org
> ---
>  drivers/net/bnx2x/elink.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
> index cceae6f9b..74e1bead3 100644
> --- a/drivers/net/bnx2x/elink.c
> +++ b/drivers/net/bnx2x/elink.c
> @@ -12921,7 +12921,7 @@ static void elink_check_kr2_wa(struct elink_params *params,
>  	 */
>  	not_kr2_device = (((base_page & 0x8000) == 0) ||
>  			  (((base_page & 0x8000) &&
> -			    ((next_page & 0xe0) == 0x2))));
> +			    ((next_page & 0xe0) == 0x20))));
>  
>  	/* In case KR2 is already disabled, check if we need to re-enable it */
>  	if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
>
  
Mody, Rasesh May 14, 2018, 10:16 p.m. UTC | #2
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andy Green

> Sent: Sunday, May 13, 2018 10:05 PM

> 

> /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:

> In function ‘elink_check_kr2_wa’:

> /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:12922:28:

> error: bitwise comparison always evaluates to false [-Werror=tautological-

> compare]

>         ((next_page & 0xe0) == 0x2))));

> 

> This was fixed elsewhere in 2014

> 

> Signed-off-by: Andy Green <andy@warmcat.com>

> Fixes: b5bf7719221d ("bnx2x: driver support routines")

> Cc: stable@dpdk.org

> ---


Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
  
Mody, Rasesh May 14, 2018, 10:17 p.m. UTC | #3
> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> Sent: Monday, May 14, 2018 4:17 AM

> To: Andy Green <andy@warmcat.com>; dev@dpdk.org; Patil, Harish

> <Harish.Patil@cavium.com>; Mody, Rasesh <Rasesh.Mody@cavium.com>

> Subject: Re: [dpdk-dev] [PATCH v3 2/4] net/bnx2x: correct unmeetable

> comparison

> 

> On 5/14/2018 6:04 AM, Andy Green wrote:

> > /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:

> > In function ‘elink_check_kr2_wa’:

> > /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:12922:28:

> > error: bitwise comparison always evaluates to false

> > [-Werror=tautological-compare]

> >         ((next_page & 0xe0) == 0x2))));

> >

> > This was fixed elsewhere in 2014

> 

> To be able to apply this fix in dpdk I think we need maintainers ack on this

> change, they are cc'ed.


Patch acked.

Thanks!
-Rasesh
 
> >

> > Signed-off-by: Andy Green <andy@warmcat.com>

> > Fixes: b5bf7719221d ("bnx2x: driver support routines")

> > Cc: stable@dpdk.org

> > ---

> >  drivers/net/bnx2x/elink.c |    2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c

> > index cceae6f9b..74e1bead3 100644

> > --- a/drivers/net/bnx2x/elink.c

> > +++ b/drivers/net/bnx2x/elink.c

> > @@ -12921,7 +12921,7 @@ static void elink_check_kr2_wa(struct

> elink_params *params,

> >  	 */

> >  	not_kr2_device = (((base_page & 0x8000) == 0) ||

> >  			  (((base_page & 0x8000) &&

> > -			    ((next_page & 0xe0) == 0x2))));

> > +			    ((next_page & 0xe0) == 0x20))));

> >

> >  	/* In case KR2 is already disabled, check if we need to re-enable it */

> >  	if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {

> >
  
Thomas Monjalon May 15, 2018, 2:46 p.m. UTC | #4
15/05/2018 00:16, Mody, Rasesh:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andy Green
> > Sent: Sunday, May 13, 2018 10:05 PM
> > 
> > /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:
> > In function ‘elink_check_kr2_wa’:
> > /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:12922:28:
> > error: bitwise comparison always evaluates to false [-Werror=tautological-
> > compare]
> >         ((next_page & 0xe0) == 0x2))));
> > 
> > This was fixed elsewhere in 2014
> > 
> > Signed-off-by: Andy Green <andy@warmcat.com>
> > Fixes: b5bf7719221d ("bnx2x: driver support routines")
> > Cc: stable@dpdk.org
> > ---
> 
> Acked-by: Rasesh Mody <rasesh.mody@cavium.com>

I would appreciate a review of the 2 other bnx2x patches in this series, please.
  
Mody, Rasesh May 15, 2018, 7:52 p.m. UTC | #5
> From: Thomas Monjalon [mailto:thomas@monjalon.net]

> Sent: Tuesday, May 15, 2018 7:46 AM

> 

> 15/05/2018 00:16, Mody, Rasesh:

> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andy Green

> > > Sent: Sunday, May 13, 2018 10:05 PM

> > >

> > > /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:

> > > In function ‘elink_check_kr2_wa’:

> > > /home/agreen/projects/dpdk/drivers/net/bnx2x/elink.c:12922:28:

> > > error: bitwise comparison always evaluates to false

> > > [-Werror=tautological- compare]

> > >         ((next_page & 0xe0) == 0x2))));

> > >

> > > This was fixed elsewhere in 2014

> > >

> > > Signed-off-by: Andy Green <andy@warmcat.com>

> > > Fixes: b5bf7719221d ("bnx2x: driver support routines")

> > > Cc: stable@dpdk.org

> > > ---

> >

> > Acked-by: Rasesh Mody <rasesh.mody@cavium.com>

> 

> I would appreciate a review of the 2 other bnx2x patches in this series,

> please.

> 

Reviewed and acked.
 
Thanks!
-Rasesh
  

Patch

diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index cceae6f9b..74e1bead3 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -12921,7 +12921,7 @@  static void elink_check_kr2_wa(struct elink_params *params,
 	 */
 	not_kr2_device = (((base_page & 0x8000) == 0) ||
 			  (((base_page & 0x8000) &&
-			    ((next_page & 0xe0) == 0x2))));
+			    ((next_page & 0xe0) == 0x20))));
 
 	/* In case KR2 is already disabled, check if we need to re-enable it */
 	if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {