diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2012-04-10 19:02:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-12 15:10:46 -0400 |
commit | f26b6f3d0a2e1dd7c9617a16b0884d21bd4ce860 (patch) | |
tree | 7e59165935573db26d49c6553f5cee92329fd12e | |
parent | 91b0ade112136a1504677defa91cf137d9a53994 (diff) |
brcm80211: replace open-coded ARRAY_SIZE with the macro
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 41 |
2 files changed, 12 insertions, 32 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c index ce8562aa5db0..0fce56235f38 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | |||
@@ -207,8 +207,7 @@ static const iqcal_gain_params_lcnphy *tbl_iqcal_gainparams_lcnphy[1] = { | |||
207 | }; | 207 | }; |
208 | 208 | ||
209 | static const u16 iqcal_gainparams_numgains_lcnphy[1] = { | 209 | static const u16 iqcal_gainparams_numgains_lcnphy[1] = { |
210 | sizeof(tbl_iqcal_gainparams_lcnphy_2G) / | 210 | ARRAY_SIZE(tbl_iqcal_gainparams_lcnphy_2G), |
211 | sizeof(*tbl_iqcal_gainparams_lcnphy_2G), | ||
212 | }; | 211 | }; |
213 | 212 | ||
214 | static const struct lcnphy_sfo_cfg lcnphy_sfo_cfg[] = { | 213 | static const struct lcnphy_sfo_cfg lcnphy_sfo_cfg[] = { |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c index 39095741fd05..812b6e38526e 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | |||
@@ -16353,11 +16353,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) | |||
16353 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, | 16353 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, |
16354 | rfseq_rx2tx_events_rev3_ipa, | 16354 | rfseq_rx2tx_events_rev3_ipa, |
16355 | rfseq_rx2tx_dlys_rev3_ipa, | 16355 | rfseq_rx2tx_dlys_rev3_ipa, |
16356 | sizeof | 16356 | ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa)); |
16357 | (rfseq_rx2tx_events_rev3_ipa) / | ||
16358 | sizeof | ||
16359 | (rfseq_rx2tx_events_rev3_ipa | ||
16360 | [0])); | ||
16361 | 16357 | ||
16362 | mod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14)); | 16358 | mod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14)); |
16363 | mod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14)); | 16359 | mod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14)); |
@@ -16858,18 +16854,13 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) | |||
16858 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, | 16854 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, |
16859 | rfseq_tx2rx_events_rev3, | 16855 | rfseq_tx2rx_events_rev3, |
16860 | rfseq_tx2rx_dlys_rev3, | 16856 | rfseq_tx2rx_dlys_rev3, |
16861 | sizeof(rfseq_tx2rx_events_rev3) / | 16857 | ARRAY_SIZE(rfseq_tx2rx_events_rev3)); |
16862 | sizeof(rfseq_tx2rx_events_rev3[0])); | ||
16863 | 16858 | ||
16864 | if (PHY_IPA(pi)) | 16859 | if (PHY_IPA(pi)) |
16865 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, | 16860 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, |
16866 | rfseq_rx2tx_events_rev3_ipa, | 16861 | rfseq_rx2tx_events_rev3_ipa, |
16867 | rfseq_rx2tx_dlys_rev3_ipa, | 16862 | rfseq_rx2tx_dlys_rev3_ipa, |
16868 | sizeof | 16863 | ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa)); |
16869 | (rfseq_rx2tx_events_rev3_ipa) / | ||
16870 | sizeof | ||
16871 | (rfseq_rx2tx_events_rev3_ipa | ||
16872 | [0])); | ||
16873 | 16864 | ||
16874 | if ((pi->sh->hw_phyrxchain != 0x3) && | 16865 | if ((pi->sh->hw_phyrxchain != 0x3) && |
16875 | (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) { | 16866 | (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) { |
@@ -16885,8 +16876,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) | |||
16885 | pi, NPHY_RFSEQ_RX2TX, | 16876 | pi, NPHY_RFSEQ_RX2TX, |
16886 | rfseq_rx2tx_events_rev3, | 16877 | rfseq_rx2tx_events_rev3, |
16887 | rfseq_rx2tx_dlys_rev3, | 16878 | rfseq_rx2tx_dlys_rev3, |
16888 | sizeof(rfseq_rx2tx_events_rev3) / | 16879 | ARRAY_SIZE(rfseq_rx2tx_events_rev3)); |
16889 | sizeof(rfseq_rx2tx_events_rev3[0])); | ||
16890 | } | 16880 | } |
16891 | 16881 | ||
16892 | if (CHSPEC_IS2G(pi->radio_chanspec)) | 16882 | if (CHSPEC_IS2G(pi->radio_chanspec)) |
@@ -17209,13 +17199,11 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) | |||
17209 | 17199 | ||
17210 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events, | 17200 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events, |
17211 | rfseq_rx2tx_dlys, | 17201 | rfseq_rx2tx_dlys, |
17212 | sizeof(rfseq_rx2tx_events) / | 17202 | ARRAY_SIZE(rfseq_rx2tx_events)); |
17213 | sizeof(rfseq_rx2tx_events[0])); | ||
17214 | 17203 | ||
17215 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events, | 17204 | wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events, |
17216 | rfseq_tx2rx_dlys, | 17205 | rfseq_tx2rx_dlys, |
17217 | sizeof(rfseq_tx2rx_events) / | 17206 | ARRAY_SIZE(rfseq_tx2rx_events)); |
17218 | sizeof(rfseq_tx2rx_events[0])); | ||
17219 | 17207 | ||
17220 | wlc_phy_workarounds_nphy_gainctrl(pi); | 17208 | wlc_phy_workarounds_nphy_gainctrl(pi); |
17221 | 17209 | ||
@@ -19357,8 +19345,7 @@ static void wlc_phy_spurwar_nphy(struct brcms_phy *pi) | |||
19357 | } | 19345 | } |
19358 | 19346 | ||
19359 | if (isAdjustNoiseVar) { | 19347 | if (isAdjustNoiseVar) { |
19360 | numTonesAdjust = sizeof(nphy_adj_tone_id_buf) / | 19348 | numTonesAdjust = ARRAY_SIZE(nphy_adj_tone_id_buf); |
19361 | sizeof(nphy_adj_tone_id_buf[0]); | ||
19362 | 19349 | ||
19363 | wlc_phy_adjust_min_noisevar_nphy( | 19350 | wlc_phy_adjust_min_noisevar_nphy( |
19364 | pi, | 19351 | pi, |
@@ -25204,32 +25191,26 @@ static u8 wlc_phy_a3_nphy(struct brcms_phy *pi, u8 start_gain, u8 core) | |||
25204 | 25191 | ||
25205 | phy_a15 = pad_gain_codes_used_2057rev5; | 25192 | phy_a15 = pad_gain_codes_used_2057rev5; |
25206 | phy_a13 = | 25193 | phy_a13 = |
25207 | sizeof(pad_gain_codes_used_2057rev5) / | 25194 | ARRAY_SIZE(pad_gain_codes_used_2057rev5) - 1; |
25208 | sizeof(pad_gain_codes_used_2057rev5 | ||
25209 | [0]) - 1; | ||
25210 | 25195 | ||
25211 | } else if ((pi->pubpi.radiorev == 7) | 25196 | } else if ((pi->pubpi.radiorev == 7) |
25212 | || (pi->pubpi.radiorev == 8)) { | 25197 | || (pi->pubpi.radiorev == 8)) { |
25213 | 25198 | ||
25214 | phy_a15 = pad_gain_codes_used_2057rev7; | 25199 | phy_a15 = pad_gain_codes_used_2057rev7; |
25215 | phy_a13 = | 25200 | phy_a13 = |
25216 | sizeof(pad_gain_codes_used_2057rev7) / | 25201 | ARRAY_SIZE(pad_gain_codes_used_2057rev7) - 1; |
25217 | sizeof(pad_gain_codes_used_2057rev7 | ||
25218 | [0]) - 1; | ||
25219 | 25202 | ||
25220 | } else { | 25203 | } else { |
25221 | 25204 | ||
25222 | phy_a15 = pad_all_gain_codes_2057; | 25205 | phy_a15 = pad_all_gain_codes_2057; |
25223 | phy_a13 = sizeof(pad_all_gain_codes_2057) / | 25206 | phy_a13 = ARRAY_SIZE(pad_all_gain_codes_2057) - |
25224 | sizeof(pad_all_gain_codes_2057[0]) - | ||
25225 | 1; | 25207 | 1; |
25226 | } | 25208 | } |
25227 | 25209 | ||
25228 | } else { | 25210 | } else { |
25229 | 25211 | ||
25230 | phy_a15 = pga_all_gain_codes_2057; | 25212 | phy_a15 = pga_all_gain_codes_2057; |
25231 | phy_a13 = sizeof(pga_all_gain_codes_2057) / | 25213 | phy_a13 = ARRAY_SIZE(pga_all_gain_codes_2057) - 1; |
25232 | sizeof(pga_all_gain_codes_2057[0]) - 1; | ||
25233 | } | 25214 | } |
25234 | 25215 | ||
25235 | phy_a14 = 0; | 25216 | phy_a14 = 0; |