lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 20 Nov 2020 15:50:00 +0800
From:   xiakaixu1987@...il.com
To:     ionut@...ula.org, kuba@...nel.org, leon@...nel.org,
        davem@...emloft.net
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Kaixu Xia <kaixuxia@...cent.com>
Subject: [PATCH] net: adaptec: remove dead code in set_vlan_mode

From: Kaixu Xia <kaixuxia@...cent.com>

The body of the if statement can be executed only when the variable
vlan_count equals to 32, so the condition of the while statement can
not be true and the while statement is dead code. Remove it.

Reported-by: Tosk Robot <tencent_os_robot@...cent.com>
Signed-off-by: Kaixu Xia <kaixuxia@...cent.com>
---
 drivers/net/ethernet/adaptec/starfire.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index 555299737b51..ad27a9fa5e95 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -1754,14 +1754,9 @@ static u32 set_vlan_mode(struct netdev_private *np)
 		filter_addr += 16;
 		vlan_count++;
 	}
-	if (vlan_count == 32) {
+	if (vlan_count == 32)
 		ret |= PerfectFilterVlan;
-		while (vlan_count < 32) {
-			writew(0, filter_addr);
-			filter_addr += 16;
-			vlan_count++;
-		}
-	}
+
 	return ret;
 }
 #endif /* VLAN_SUPPORT */
-- 
2.20.0

Powered by blists - more mailing lists