]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
brcm80211: smac: remove redundant assignments from txpwrctrl_pwr_setup_nphy
authorArend van Spriel <arend@broadcom.com>
Thu, 9 Feb 2012 20:08:57 +0000 (21:08 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Feb 2012 19:48:50 +0000 (14:48 -0500)
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>
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c

index c27ec7a9af21cddb9fbe9ce6e2f2add0af621ec0..9595ecd38c1f1d4d14807f03a0dbf0e5a4fab39e 100644 (file)
@@ -17824,8 +17824,6 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
        if (pi->sh->sromrev < 4) {
                idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g;
                idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g;
-               target_pwr_qtrdbm[0] = 13 * 4;
-               target_pwr_qtrdbm[1] = 13 * 4;
                a1[0] = -424;
                a1[1] = -424;
                b0[0] = 5612;
@@ -17839,10 +17837,6 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
                case WL_CHAN_FREQ_RANGE_2G:
                        idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g;
                        idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g;
-                       target_pwr_qtrdbm[0] =
-                               pi->nphy_pwrctrl_info[0].max_pwr_2g;
-                       target_pwr_qtrdbm[1] =
-                               pi->nphy_pwrctrl_info[1].max_pwr_2g;
                        a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_a1;
                        a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_2g_a1;
                        b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_2g_b0;
@@ -17853,10 +17847,6 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
                case WL_CHAN_FREQ_RANGE_5GL:
                        idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g;
                        idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g;
-                       target_pwr_qtrdbm[0] =
-                               pi->nphy_pwrctrl_info[0].max_pwr_5gl;
-                       target_pwr_qtrdbm[1] =
-                               pi->nphy_pwrctrl_info[1].max_pwr_5gl;
                        a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_a1;
                        a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gl_a1;
                        b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gl_b0;
@@ -17867,10 +17857,6 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
                case WL_CHAN_FREQ_RANGE_5GM:
                        idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g;
                        idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g;
-                       target_pwr_qtrdbm[0] =
-                               pi->nphy_pwrctrl_info[0].max_pwr_5gm;
-                       target_pwr_qtrdbm[1] =
-                               pi->nphy_pwrctrl_info[1].max_pwr_5gm;
                        a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_a1;
                        a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gm_a1;
                        b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gm_b0;
@@ -17881,10 +17867,6 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
                case WL_CHAN_FREQ_RANGE_5GH:
                        idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_5g;
                        idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_5g;
-                       target_pwr_qtrdbm[0] =
-                               pi->nphy_pwrctrl_info[0].max_pwr_5gh;
-                       target_pwr_qtrdbm[1] =
-                               pi->nphy_pwrctrl_info[1].max_pwr_5gh;
                        a1[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_a1;
                        a1[1] = pi->nphy_pwrctrl_info[1].pwrdet_5gh_a1;
                        b0[0] = pi->nphy_pwrctrl_info[0].pwrdet_5gh_b0;
@@ -17895,8 +17877,6 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
                default:
                        idle_tssi[0] = pi->nphy_pwrctrl_info[0].idle_tssi_2g;
                        idle_tssi[1] = pi->nphy_pwrctrl_info[1].idle_tssi_2g;
-                       target_pwr_qtrdbm[0] = 13 * 4;
-                       target_pwr_qtrdbm[1] = 13 * 4;
                        a1[0] = -424;
                        a1[1] = -424;
                        b0[0] = 5612;
@@ -17907,6 +17887,7 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
                }
        }
 
+       /* use the provided transmit power */
        target_pwr_qtrdbm[0] = (s8) pi->tx_power_max;
        target_pwr_qtrdbm[1] = (s8) pi->tx_power_max;