Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

brcm80211: smac: remove redundant assignments from txpwrctrl_pwr_setup_nphy

The function wlc_phy_txpwrctrl_pwr_setup_nphy() does assign a local
variable target_pwr_qtrdbm in several code paths, but in the end all
code paths are coming to an assignment of that variable which does
override all previous. So those early and redundant assignments have
been removed.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Arend van Spriel and committed by
John W. Linville
01343537 1570e53c

+1 -20
+1 -20
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
··· 17824 17824 if (pi->sh->sromrev < 4) { 17825 17825 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g; 17826 17826 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g; 17827 - target_pwr_qtrdbm[0] = 13 * 4; 17828 - target_pwr_qtrdbm[1] = 13 * 4; 17829 17827 a1[0] = -424; 17830 17828 a1[1] = -424; 17831 17829 b0[0] = 5612; ··· 17837 17839 case WL_CHAN_FREQ_RANGE_2G: 17838 17840 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g; 17839 17841 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g; 17840 - target_pwr_qtrdbm[0] = 17841 - pi->nphy_pwrctrl_info[0].max_pwr_2g; 17842 - target_pwr_qtrdbm[1] = 17843 - pi->nphy_pwrctrl_info[1].max_pwr_2g; 17844 17842 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_a1; 17845 17843 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_2g_a1; 17846 17844 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_b0; ··· 17847 17853 case WL_CHAN_FREQ_RANGE_5GL: 17848 17854 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g; 17849 17855 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g; 17850 - target_pwr_qtrdbm[0] = 17851 - pi->nphy_pwrctrl_info[0].max_pwr_5gl; 17852 - target_pwr_qtrdbm[1] = 17853 - pi->nphy_pwrctrl_info[1].max_pwr_5gl; 17854 17856 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_a1; 17855 17857 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gl_a1; 17856 17858 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_b0; ··· 17857 17867 case WL_CHAN_FREQ_RANGE_5GM: 17858 17868 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g; 17859 17869 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g; 17860 - target_pwr_qtrdbm[0] = 17861 - pi->nphy_pwrctrl_info[0].max_pwr_5gm; 17862 - target_pwr_qtrdbm[1] = 17863 - pi->nphy_pwrctrl_info[1].max_pwr_5gm; 17864 17870 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_a1; 17865 17871 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gm_a1; 17866 17872 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_b0; ··· 17867 17881 case WL_CHAN_FREQ_RANGE_5GH: 17868 17882 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g; 17869 17883 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g; 17870 - target_pwr_qtrdbm[0] = 17871 - pi->nphy_pwrctrl_info[0].max_pwr_5gh; 17872 - target_pwr_qtrdbm[1] = 17873 - pi->nphy_pwrctrl_info[1].max_pwr_5gh; 17874 17884 a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_a1; 17875 17885 a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gh_a1; 17876 17886 b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_b0; ··· 17877 17895 default: 17878 17896 idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g; 17879 17897 idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g; 17880 - target_pwr_qtrdbm[0] = 13 * 4; 17881 - target_pwr_qtrdbm[1] = 13 * 4; 17882 17898 a1[0] = -424; 17883 17899 a1[1] = -424; 17884 17900 b0[0] = 5612; ··· 17887 17907 } 17888 17908 } 17889 17909 17910 + /* use the provided transmit power */ 17890 17911 target_pwr_qtrdbm[0] = (s8) pi->tx_power_max; 17891 17912 target_pwr_qtrdbm[1] = (s8) pi->tx_power_max; 17892 17913