brcm80211: replace open-coded ARRAY_SIZE with the macro
authorJim Cromie <jim.cromie@gmail.com>
Tue, 10 Apr 2012 23:02:34 +0000 (17:02 -0600)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 12 Apr 2012 19:10:46 +0000 (15:10 -0400)
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>
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c

index ce8562aa5db0bee06c59244ef9c3099b6cf58c81..0fce56235f38c2040d6b6bff716029d23a6030d6 100644 (file)
@@ -207,8 +207,7 @@ static const iqcal_gain_params_lcnphy *tbl_iqcal_gainparams_lcnphy[1] = {
 };
 
 static const u16 iqcal_gainparams_numgains_lcnphy[1] = {
-       sizeof(tbl_iqcal_gainparams_lcnphy_2G) /
-       sizeof(*tbl_iqcal_gainparams_lcnphy_2G),
+       ARRAY_SIZE(tbl_iqcal_gainparams_lcnphy_2G),
 };
 
 static const struct lcnphy_sfo_cfg lcnphy_sfo_cfg[] = {
index 39095741fd05f948a9538d1b2740db7530112ccc..812b6e38526e3252bc1e720a70c51ee8d502232c 100644 (file)
@@ -16353,11 +16353,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
                        wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,
                                               rfseq_rx2tx_events_rev3_ipa,
                                               rfseq_rx2tx_dlys_rev3_ipa,
-                                              sizeof
-                                              (rfseq_rx2tx_events_rev3_ipa) /
-                                              sizeof
-                                              (rfseq_rx2tx_events_rev3_ipa
-                                               [0]));
+                                              ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa));
 
                mod_phy_reg(pi, 0x299, (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)
                wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX,
                                       rfseq_tx2rx_events_rev3,
                                       rfseq_tx2rx_dlys_rev3,
-                                      sizeof(rfseq_tx2rx_events_rev3) /
-                                      sizeof(rfseq_tx2rx_events_rev3[0]));
+                                      ARRAY_SIZE(rfseq_tx2rx_events_rev3));
 
                if (PHY_IPA(pi))
                        wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_RX2TX,
                                               rfseq_rx2tx_events_rev3_ipa,
                                               rfseq_rx2tx_dlys_rev3_ipa,
-                                              sizeof
-                                              (rfseq_rx2tx_events_rev3_ipa) /
-                                              sizeof
-                                              (rfseq_rx2tx_events_rev3_ipa
-                                               [0]));
+                                              ARRAY_SIZE(rfseq_rx2tx_events_rev3_ipa));
 
                if ((pi->sh->hw_phyrxchain != 0x3) &&
                    (pi->sh->hw_phyrxchain != pi->sh->hw_phytxchain)) {
@@ -16885,8 +16876,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
                                pi, NPHY_RFSEQ_RX2TX,
                                rfseq_rx2tx_events_rev3,
                                rfseq_rx2tx_dlys_rev3,
-                               sizeof(rfseq_rx2tx_events_rev3) /
-                               sizeof(rfseq_rx2tx_events_rev3[0]));
+                               ARRAY_SIZE(rfseq_rx2tx_events_rev3));
                }
 
                if (CHSPEC_IS2G(pi->radio_chanspec))
@@ -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,
                                       rfseq_rx2tx_dlys,
-                                      sizeof(rfseq_rx2tx_events) /
-                                      sizeof(rfseq_rx2tx_events[0]));
+                                      ARRAY_SIZE(rfseq_rx2tx_events));
 
                wlc_phy_set_rfseq_nphy(pi, NPHY_RFSEQ_TX2RX, rfseq_tx2rx_events,
                                       rfseq_tx2rx_dlys,
-                                      sizeof(rfseq_tx2rx_events) /
-                                      sizeof(rfseq_tx2rx_events[0]));
+                                      ARRAY_SIZE(rfseq_tx2rx_events));
 
                wlc_phy_workarounds_nphy_gainctrl(pi);
 
@@ -19357,8 +19345,7 @@ static void wlc_phy_spurwar_nphy(struct brcms_phy *pi)
                        }
 
                        if (isAdjustNoiseVar) {
-                               numTonesAdjust = sizeof(nphy_adj_tone_id_buf) /
-                                               sizeof(nphy_adj_tone_id_buf[0]);
+                               numTonesAdjust = ARRAY_SIZE(nphy_adj_tone_id_buf);
 
                                wlc_phy_adjust_min_noisevar_nphy(
                                        pi,
@@ -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_a13 =
-                                       sizeof(pad_gain_codes_used_2057rev5) /
-                                       sizeof(pad_gain_codes_used_2057rev5
-                                               [0]) - 1;
+                                       ARRAY_SIZE(pad_gain_codes_used_2057rev5) - 1;
 
                        } else if ((pi->pubpi.radiorev == 7)
                                   || (pi->pubpi.radiorev == 8)) {
 
                                phy_a15 = pad_gain_codes_used_2057rev7;
                                phy_a13 =
-                                       sizeof(pad_gain_codes_used_2057rev7) /
-                                       sizeof(pad_gain_codes_used_2057rev7
-                                               [0]) - 1;
+                                       ARRAY_SIZE(pad_gain_codes_used_2057rev7) - 1;
 
                        } else {
 
                                phy_a15 = pad_all_gain_codes_2057;
-                               phy_a13 = sizeof(pad_all_gain_codes_2057) /
-                                         sizeof(pad_all_gain_codes_2057[0]) -
+                               phy_a13 = ARRAY_SIZE(pad_all_gain_codes_2057) -
                                          1;
                        }
 
                } else {
 
                        phy_a15 = pga_all_gain_codes_2057;
-                       phy_a13 = sizeof(pga_all_gain_codes_2057) /
-                                 sizeof(pga_all_gain_codes_2057[0]) - 1;
+                       phy_a13 = ARRAY_SIZE(pga_all_gain_codes_2057) - 1;
                }
 
                phy_a14 = 0;