Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fd544c8 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller
Browse files

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: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6534770d
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -956,9 +956,13 @@ static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
	} else if (is_valid_ether_addr(vf->vf_mac_addr)) {
	} else if (is_valid_ether_addr(vf->vf_mac_addr)) {
		if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr))
		if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr))
			mac_ok = true;
			mac_ok = true;
	} else if (bp->hwrm_spec_code < 0x10202) {
		mac_ok = true;
	} else {
	} else {
		/* There are two cases:
		 * 1.If firmware spec < 0x10202,VF MAC address is not forwarded
		 *   to the PF and so it doesn't have to match
		 * 2.Allow VF to modify it's own MAC when PF has not assigned a
		 *   valid MAC address and firmware spec >= 0x10202
		 */
		mac_ok = true;
		mac_ok = true;
	}
	}
	if (mac_ok)
	if (mac_ok)