wifi: brcmsmac: phy: Remove unreachable code
authorArtem Chernyshev <artem.chernyshev@red-soft.ru>
Mon, 14 Aug 2023 09:36:21 +0000 (12:36 +0300)
committerKalle Valo <kvalo@kernel.org>
Thu, 18 Jan 2024 13:04:28 +0000 (15:04 +0200)
wlc_phy_txpwr_srom_read_nphy() in wlc_phy_attach_nphy() can not
return false, so it's impossible to get true value in this
if-statement. Also change those functions return types to void
since no one using it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20230814093621.289754-1-artem.chernyshev@red-soft.ru
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_int.h
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c

index ccc621b8ed9f2b21f107d37f605d710f90c7d92b..07f83ff5a54ab0d1a8db6c67bbb1abd80653d62b 100644 (file)
@@ -551,8 +551,7 @@ wlc_phy_attach(struct shared_phy *sh, struct bcma_device *d11core,
                if (!pi->phycal_timer)
                        goto err;
 
-               if (!wlc_phy_attach_nphy(pi))
-                       goto err;
+               wlc_phy_attach_nphy(pi);
 
        } else if (ISLCNPHY(pi)) {
                if (!wlc_phy_attach_lcnphy(pi))
index 8668fa5558a26306e3bd51942fe24c7309b3437a..70a9ec0507172ebf820edd74c339d1ae1bb4d0ec 100644 (file)
@@ -941,7 +941,7 @@ void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag);
 void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
 void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
 
-bool wlc_phy_attach_nphy(struct brcms_phy *pi);
+void wlc_phy_attach_nphy(struct brcms_phy *pi);
 bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
 
 void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
index 8580a275478918f9e140d378b20e6c84f4325dd6..cd9b502a6a9fc31b91d71144dc4e347cf40593f4 100644 (file)
@@ -14546,7 +14546,7 @@ static void wlc_phy_txpwr_srom_read_ppr_nphy(struct brcms_phy *pi)
        wlc_phy_txpwr_apply_nphy(pi);
 }
 
-static bool wlc_phy_txpwr_srom_read_nphy(struct brcms_phy *pi)
+static void wlc_phy_txpwr_srom_read_nphy(struct brcms_phy *pi)
 {
        struct ssb_sprom *sprom = &pi->d11core->bus->sprom;
 
@@ -14595,11 +14595,9 @@ static bool wlc_phy_txpwr_srom_read_nphy(struct brcms_phy *pi)
                pi->phycal_tempdelta = 0;
 
        wlc_phy_txpwr_srom_read_ppr_nphy(pi);
-
-       return true;
 }
 
-bool wlc_phy_attach_nphy(struct brcms_phy *pi)
+void wlc_phy_attach_nphy(struct brcms_phy *pi)
 {
        uint i;
 
@@ -14645,10 +14643,7 @@ bool wlc_phy_attach_nphy(struct brcms_phy *pi)
        pi->pi_fptr.chanset = wlc_phy_chanspec_set_nphy;
        pi->pi_fptr.txpwrrecalc = wlc_phy_txpower_recalc_target_nphy;
 
-       if (!wlc_phy_txpwr_srom_read_nphy(pi))
-               return false;
-
-       return true;
+       wlc_phy_txpwr_srom_read_nphy(pi);
 }
 
 static s32 get_rf_pwr_offset(struct brcms_phy *pi, s16 pga_gn, s16 pad_gn)