aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-08-03 04:48:56 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-03 12:42:00 -0400
commit6fd544c897d98bc6f185da215f1585dc144218cc (patch)
tree38dc7d50f525c1906a5906d976ea3d88a44059d4
parent6534770d6f176093b50896961107b2d545ef38f0 (diff)
bnxt_en: combine 'else if' and 'else' into single branch
The else-if branch and else branch set mac_ok to true similarly, so combine the two into single else branch. Also add comments to explain the two conditions, which from Michael Chan and Vasundhara Volam. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index a64910892c25..f560845c5a9d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -956,9 +956,13 @@ static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
956 } else if (is_valid_ether_addr(vf->vf_mac_addr)) { 956 } else if (is_valid_ether_addr(vf->vf_mac_addr)) {
957 if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr)) 957 if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr))
958 mac_ok = true; 958 mac_ok = true;
959 } else if (bp->hwrm_spec_code < 0x10202) {
960 mac_ok = true;
961 } else { 959 } else {
960 /* There are two cases:
961 * 1.If firmware spec < 0x10202,VF MAC address is not forwarded
962 * to the PF and so it doesn't have to match
963 * 2.Allow VF to modify it's own MAC when PF has not assigned a
964 * valid MAC address and firmware spec >= 0x10202
965 */
962 mac_ok = true; 966 mac_ok = true;
963 } 967 }
964 if (mac_ok) 968 if (mac_ok)