iavf: Remove useless else if
Subsystems (3)
PATCH v2 1/1 iavf: Remove useless else if
The assignment of the else and if branches is the same, so the if else here is redundant, so we remove it.
./drivers/net/ethernet/intel/iavf/iavf_main.c:2203:6-8: WARNING: possible condition with no effect (if == else).
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
---
Changes in v2:
-Add a comment.
drivers/net/ethernet/intel/iavf/iavf_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +3 -3
@@ -2200,9 +2200,9 @@ iavf_set_vlan_offload_features(struct iavf_adapter *adapter, vlan_ethertype =ETH_P_8021Q ; else if (prev_features & (NETIF_F_HW_VLAN_STAG_RX | NETIF_F_HW_VLAN_STAG_TX)) vlan_ethertype =ETH_P_8021AD ; - else if (prev_features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX)) - vlan_ethertype =ETH_P_8021Q ; - else + else /* The branch cover "else if (prev_features & (NETIF_F_HW_VLAN_CTAG_RX | +* NETIF_F_HW_VLAN_CTAG_TX))" +*/ vlan_ethertype =ETH_P_8021Q ;if (!(features & (NETIF_F_HW_VLAN_STAG_RX |NETIF_F_HW_VLAN_CTAG_RX )))
Signature · 6 lines
2.20.1.7.g153144c _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Jakub Kicinski
maintainerQuoted 8 lines · On Wed, 24 May 2023 18:02:03 +0800 Jiapeng Chong wrote:
The assignment of the else and if branches is the same, so the if else here is redundant, so we remove it.
./drivers/net/ethernet/intel/iavf/iavf_main.c:2203:6-8: WARNING: possible condition with no effect (if == else).
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>
Looking thru git history most of the patches you send for this check are converting perfectly valid code. Please change the check to ignore
if (cond)
/*A*/ else if (cond2) /*B*/ else /*B*/
Signature · 1 line
pw-bot: reject