iavf: Remove useless else if
Subsystems (3)
PATCH 1/1 iavf: Remove useless else if
The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it and add a comment to make the code here readable.
./drivers/net/ethernet/intel/iavf/iavf_main.c:2211:6-8: WARNING: possible condition with no effect (if == else).
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -3
@@ -2208,9 +2208,7 @@ 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 /* contains 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 · 1 line
2.20.1.7.g153144c
Tony Nguyen
maintainerQuoted 5 lines · Jiapeng Chong
The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it and add a comment to make the code here readable.
./drivers/net/ethernet/intel/iavf/iavf_main.c:2211:6-8: WARNING: possible condition with no effect (if == else).
This was already nacked by Jakub [1].
Thanks,
Tony
Quoted 3 lines
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>