Skip to contentSkip to conversation

brcm80211: brcmsmac: phy_lcn: remove duplicate code

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Apr 5, 2018 – Apr 25, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcm80211: brcmsmac: phy_lcn: remove duplicate code

Remove and refactor some code in order to avoid having identical code for different branches.

Notice that this piece of code hasn't been modified since 2011.

Addresses-Coverity-ID: 1226756 ("Identical code for different branches")

---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c +2 -7
index 93d4cde..9d830d2 100644
@@ -3388,13 +3388,8 @@ void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode)
 	u8 phybw40;
 	phybw40 = CHSPEC_IS40(pi->radio_chanspec);
 
-	if (LCNREV_LT(pi->pubpi.phy_rev, 2)) {
-		mod_phy_reg(pi, 0x4b0, (0x1 << 5), (mode) << 5);
-		mod_phy_reg(pi, 0x4b1, (0x1 << 9), 0 << 9);
-	} else {
-		mod_phy_reg(pi, 0x4b0, (0x1 << 5), (mode) << 5);
-		mod_phy_reg(pi, 0x4b1, (0x1 << 9), 0 << 9);
-	}
+	mod_phy_reg(pi, 0x4b0, (0x1 << 5), (mode) << 5);
+	mod_phy_reg(pi, 0x4b1, (0x1 << 9), 0 << 9);
 
 	if (phybw40 == 0) {
 		mod_phy_reg((pi), 0x410,
Signature · 1 line
2.7.4
#1 lore raw

Re: brcmsmac: phy_lcn: remove duplicate code

Quoted 7 lines · Gustavo A. R. Silva

Remove and refactor some code in order to avoid having identical code for different branches.

Notice that this piece of code hasn't been modified since 2011.

Addresses-Coverity-ID: 1226756 ("Identical code for different branches")

Patch applied to wireless-drivers-next.git, thanks.

863683cfbbfc brcmsmac: phy_lcn: remove duplicate code

Signature · 3 lines
https://patchwork.kernel.org/patch/10323665/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches