[PATCH] net: adaptec: remove dead code in set_vlan_mode
From: xiakaixu1987
Date: Fri Nov 20 2020 - 02:50:10 EST
From: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
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@xxxxxxxxxxx>
Signed-off-by: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
---
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