Commit f26b6f3d authored by Jim Cromie's avatar Jim Cromie Committed by John W. Linville

brcm80211: replace open-coded ARRAY_SIZE with the macro

Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
Acked-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 91b0ade1
...@@ -207,8 +207,7 @@ static const iqcal_gain_params_lcnphy *tbl_iqcal_gainparams_lcnphy[1] = { ...@@ -207,8 +207,7 @@ static const iqcal_gain_params_lcnphy *tbl_iqcal_gainparams_lcnphy[1] = {
}; };
static const u16 iqcal_gainparams_numgains_lcnphy[1] = { static const u16 iqcal_gainparams_numgains_lcnphy[1] = {
sizeof(tbl_iqcal_gainparams_lcnphy_2G) / ARRAY_SIZE(tbl_iqcal_gainparams_lcnphy_2G),
sizeof(*tbl_iqcal_gainparams_lcnphy_2G),
}; };
static const struct lcnphy_sfo_cfg lcnphy_sfo_cfg[] = { static const struct lcnphy_sfo_cfg lcnphy_sfo_cfg[] = {
......
...@@ -16353,11 +16353,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) ...@@ -16353,11 +16353,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,
rfseq_rx2tx_events_rev3_ipa, rfseq_rx2tx_events_rev3_ipa,
rfseq_rx2tx_dlys_rev3_ipa, rfseq_rx2tx_dlys_rev3_ipa,
sizeof ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa));
(rfseq_rx2tx_events_rev3_ipa) /
sizeof
(rfseq_rx2tx_events_rev3_ipa
[0]));
mod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14)); mod_phy_reg(pi, 0x299, (0x3 << 14), (0x1 << 14));
mod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14)); mod_phy_reg(pi, 0x29d, (0x3 << 14), (0x1 << 14));
...@@ -16858,18 +16854,13 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) ...@@ -16858,18 +16854,13 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX,
rfseq_tx2rx_events_rev3, rfseq_tx2rx_events_rev3,
rfseq_tx2rx_dlys_rev3, rfseq_tx2rx_dlys_rev3,
sizeof(rfseq_tx2rx_events_rev3) / ARRAY_SIZE(rfseq_tx2rx_events_rev3));
sizeof(rfseq_tx2rx_events_rev3[0]));
if (PHY_IPA(pi)) if (PHY_IPA(pi))
wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,
rfseq_rx2tx_events_rev3_ipa, rfseq_rx2tx_events_rev3_ipa,
rfseq_rx2tx_dlys_rev3_ipa, rfseq_rx2tx_dlys_rev3_ipa,
sizeof ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa));
(rfseq_rx2tx_events_rev3_ipa) /
sizeof
(rfseq_rx2tx_events_rev3_ipa
[0]));
if ((pi->sh->hw_phyrxchain != 0x3) && if ((pi->sh->hw_phyrxchain != 0x3) &&
(pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) { (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) {
...@@ -16885,8 +16876,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) ...@@ -16885,8 +16876,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
pi, NPHY_RFSEQ_RX2TX, pi, NPHY_RFSEQ_RX2TX,
rfseq_rx2tx_events_rev3, rfseq_rx2tx_events_rev3,
rfseq_rx2tx_dlys_rev3, rfseq_rx2tx_dlys_rev3,
sizeof(rfseq_rx2tx_events_rev3) / ARRAY_SIZE(rfseq_rx2tx_events_rev3));
sizeof(rfseq_rx2tx_events_rev3[0]));
} }
if (CHSPEC_IS2G(pi->radio_chanspec)) if (CHSPEC_IS2G(pi->radio_chanspec))
...@@ -17209,13 +17199,11 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi) ...@@ -17209,13 +17199,11 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events, wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX, rfseq_rx2tx_events,
rfseq_rx2tx_dlys, rfseq_rx2tx_dlys,
sizeof(rfseq_rx2tx_events) / ARRAY_SIZE(rfseq_rx2tx_events));
sizeof(rfseq_rx2tx_events[0]));
wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events, wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events,
rfseq_tx2rx_dlys, rfseq_tx2rx_dlys,
sizeof(rfseq_tx2rx_events) / ARRAY_SIZE(rfseq_tx2rx_events));
sizeof(rfseq_tx2rx_events[0]));
wlc_phy_workarounds_nphy_gainctrl(pi); wlc_phy_workarounds_nphy_gainctrl(pi);
...@@ -19357,8 +19345,7 @@ static void wlc_phy_spurwar_nphy(struct brcms_phy *pi) ...@@ -19357,8 +19345,7 @@ static void wlc_phy_spurwar_nphy(struct brcms_phy *pi)
} }
if (isAdjustNoiseVar) { if (isAdjustNoiseVar) {
numTonesAdjust = sizeof(nphy_adj_tone_id_buf) / numTonesAdjust = ARRAY_SIZE(nphy_adj_tone_id_buf);
sizeof(nphy_adj_tone_id_buf[0]);
wlc_phy_adjust_min_noisevar_nphy( wlc_phy_adjust_min_noisevar_nphy(
pi, pi,
...@@ -25204,32 +25191,26 @@ static u8 wlc_phy_a3_nphy(struct brcms_phy *pi, u8 start_gain, u8 core) ...@@ -25204,32 +25191,26 @@ static u8 wlc_phy_a3_nphy(struct brcms_phy *pi, u8 start_gain, u8 core)
phy_a15 = pad_gain_codes_used_2057rev5; phy_a15 = pad_gain_codes_used_2057rev5;
phy_a13 = phy_a13 =
sizeof(pad_gain_codes_used_2057rev5) / ARRAY_SIZE(pad_gain_codes_used_2057rev5) - 1;
sizeof(pad_gain_codes_used_2057rev5
[0]) - 1;
} else if ((pi->pubpi.radiorev == 7) } else if ((pi->pubpi.radiorev == 7)
|| (pi->pubpi.radiorev == 8)) { || (pi->pubpi.radiorev == 8)) {
phy_a15 = pad_gain_codes_used_2057rev7; phy_a15 = pad_gain_codes_used_2057rev7;
phy_a13 = phy_a13 =
sizeof(pad_gain_codes_used_2057rev7) / ARRAY_SIZE(pad_gain_codes_used_2057rev7) - 1;
sizeof(pad_gain_codes_used_2057rev7
[0]) - 1;
} else { } else {
phy_a15 = pad_all_gain_codes_2057; phy_a15 = pad_all_gain_codes_2057;
phy_a13 = sizeof(pad_all_gain_codes_2057) / phy_a13 = ARRAY_SIZE(pad_all_gain_codes_2057) -
sizeof(pad_all_gain_codes_2057[0]) -
1; 1;
} }
} else { } else {
phy_a15 = pga_all_gain_codes_2057; phy_a15 = pga_all_gain_codes_2057;
phy_a13 = sizeof(pga_all_gain_codes_2057) / phy_a13 = ARRAY_SIZE(pga_all_gain_codes_2057) - 1;
sizeof(pga_all_gain_codes_2057[0]) - 1;
} }
phy_a14 = 0; phy_a14 = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment