[dpdk-dev] [PATCH 2/4] net/bnx2x: remove unmeetable comparison

Andy Green andy at warmcat.com
Fri May 11 03:51:22 CEST 2018


/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))));
---
 drivers/net/bnx2x/elink.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c
index 99684a5f9..2aef2b6da 100644
--- a/drivers/net/bnx2x/elink.c
+++ b/drivers/net/bnx2x/elink.c
@@ -12919,9 +12919,7 @@ static void elink_check_kr2_wa(struct elink_params *params,
 	 * but only KX is advertised, declare this link partner as non-KR2
 	 * device.
 	 */
-	not_kr2_device = (((base_page & 0x8000) == 0) ||
-			  (((base_page & 0x8000) &&
-			    ((next_page & 0xe0) == 0x2))));
+	not_kr2_device = !(base_page & 0x8000);
 
 	/* In case KR2 is already disabled, check if we need to re-enable it */
 	if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {



More information about the dev mailing list