From: Greg Kroah-Hartman Date: Fri, 8 Oct 2010 18:47:11 +0000 (-0700) Subject: Staging: brcm80211: remove ARRAYSIZE macro X-Git-Tag: v2.6.37-rc1~60^2~3^2~203 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=8d3d6a6945df5c78c7f7882dabdb5638b05b2f5c;p=net-next-2.6.git Staging: brcm80211: remove ARRAYSIZE macro Use the real 'ARRAY_SIZE' definition instead. Cc: Brett Rudley Cc: Henry Ptasinski Cc: Nohee Ko Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmfmac/bcmutils.c b/drivers/staging/brcm80211/brcmfmac/bcmutils.c index 1eecf1a2b64..1bc7b5ee8c3 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmutils.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmutils.c @@ -945,7 +945,7 @@ const char *bcmerrorstr(int bcmerror) { /* check if someone added a bcmerror code but forgot to add errorstring */ - ASSERT(ABS(BCME_LAST) == (ARRAYSIZE(bcmerrorstrtable) - 1)); + ASSERT(ABS(BCME_LAST) == (ARRAY_SIZE(bcmerrorstrtable) - 1)); if (bcmerror > 0 || bcmerror < BCME_LAST) { snprintf(bcm_undeferrstr, BCME_STRLEN, "Undefined error %d", diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c index cf85391b1a5..4cdecaa4b00 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c @@ -607,7 +607,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) (unsigned char) event->addr.octet[5] & 0xff); event_name = "UNKNOWN"; - for (i = 0; i < ARRAYSIZE(event_names); i++) { + for (i = 0; i < ARRAY_SIZE(event_names); i++) { if (event_names[i].event == event_type) event_name = event_names[i].event_name; } diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index 9b5da84f4d0..ca4f0b34c01 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c @@ -701,7 +701,7 @@ wl_iw_set_spy(struct net_device *dev, if (!extra) return -EINVAL; - iw->spy_num = min(ARRAYSIZE(iw->spy_addr), dwrq->length); + iw->spy_num = min(ARRAY_SIZE(iw->spy_addr), dwrq->length); for (i = 0; i < iw->spy_num; i++) memcpy(&iw->spy_addr[i], addr[i].sa_data, ETHER_ADDR_LEN); memset(iw->spy_qual, 0, sizeof(iw->spy_qual)); @@ -3165,7 +3165,7 @@ static const iw_handler wl_iw_handler[] = { #if WIRELESS_EXT > 12 const struct iw_handler_def wl_iw_handler_def = { - .num_standard = ARRAYSIZE(wl_iw_handler), + .num_standard = ARRAY_SIZE(wl_iw_handler), .standard = (iw_handler *) wl_iw_handler, .num_private = 0, .num_private_args = 0, @@ -3189,7 +3189,7 @@ int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) WL_TRACE(("\n%s, cmd:%x alled via dhd->do_ioctl()entry point\n", __func__, cmd)); if (cmd < SIOCIWFIRST || - IW_IOCTL_IDX(cmd) >= ARRAYSIZE(wl_iw_handler)) { + IW_IOCTL_IDX(cmd) >= ARRAY_SIZE(wl_iw_handler)) { WL_ERROR(("%s: error in cmd=%x : out of range\n", __func__, cmd)); return -EOPNOTSUPP; diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h index 0421247b594..40b579f3e1a 100644 --- a/drivers/staging/brcm80211/include/bcmutils.h +++ b/drivers/staging/brcm80211/include/bcmutils.h @@ -456,9 +456,6 @@ extern "C" { & ~((boundary) - 1)) #define ISPOWEROF2(x) ((((x)-1)&(x)) == 0) #define VALID_MASK(mask) (!((mask) & ((mask) + 1))) -#ifndef ARRAYSIZE -#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0])) -#endif /* bit map related macros */ #ifndef setbit diff --git a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c index 26ff202fe0f..0769287f498 100644 --- a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c +++ b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c @@ -1521,7 +1521,7 @@ int wlc_phy_channel2freq(uint channel) { uint i; - for (i = 0; i < ARRAYSIZE(chan_info_all); i++) + for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) if (chan_info_all[i].chan == channel) return chan_info_all[i].freq; return 0; @@ -1538,7 +1538,7 @@ wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels) bzero(channels, sizeof(chanvec_t)); - for (i = 0; i < ARRAYSIZE(chan_info_all); i++) { + for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) { channel = chan_info_all[i].chan; if ((pi->a_band_high_disable) && (channel >= FIRST_REF5_CHANNUM) @@ -1560,19 +1560,19 @@ chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band) ASSERT((band == WLC_BAND_2G) || (band == WLC_BAND_5G)); - for (i = 0; i < ARRAYSIZE(chan_info_all); i++) { + for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) { channel = chan_info_all[i].chan; if (ISNPHY(pi) && IS40MHZ(pi)) { uint j; - for (j = 0; j < ARRAYSIZE(chan_info_all); j++) { + for (j = 0; j < ARRAY_SIZE(chan_info_all); j++) { if (chan_info_all[j].chan == channel + CH_10MHZ_APART) break; } - if (j == ARRAYSIZE(chan_info_all)) + if (j == ARRAY_SIZE(chan_info_all)) continue; channel = UPPER_20_SB(channel); @@ -1725,12 +1725,12 @@ wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint channel, u8 *min_pwr, if (txp_rate_idx < 0) txp_rate_idx = TXP_FIRST_OFDM; - for (i = 0; i < ARRAYSIZE(chan_info_all); i++) { + for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) { if (channel == chan_info_all[i].chan) { break; } } - ASSERT(i < ARRAYSIZE(chan_info_all)); + ASSERT(i < ARRAY_SIZE(chan_info_all)); if (pi->hwtxpwr) { *max_pwr = pi->hwtxpwr[i]; diff --git a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c index 0863a870403..40247417b75 100644 --- a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c +++ b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c @@ -1621,7 +1621,7 @@ void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi) if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi)) return; - for (i = 0, j = 0; i < ARRAYSIZE(rate_table); i++, j++) { + for (i = 0, j = 0; i < ARRAY_SIZE(rate_table); i++, j++) { if (i == WLC_NUM_RATES_CCK + WLC_NUM_RATES_OFDM) j = TXP_FIRST_MCS_20_SISO; @@ -1631,7 +1631,7 @@ void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi) tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL; tab.tbl_width = 32; - tab.tbl_len = ARRAYSIZE(rate_table); + tab.tbl_len = ARRAY_SIZE(rate_table); tab.tbl_ptr = rate_table; tab.tbl_offset = LCNPHY_TX_PWR_CTRL_RATE_OFFSET; wlc_lcnphy_write_table(pi, &tab); @@ -1900,7 +1900,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, case LCNPHY_CAL_FULL: start_coeffs = syst_coeffs; cal_cmds = commands_fullcal; - n_cal_cmds = ARRAYSIZE(commands_fullcal); + n_cal_cmds = ARRAY_SIZE(commands_fullcal); break; case LCNPHY_CAL_RECAL: @@ -1909,7 +1909,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, start_coeffs = syst_coeffs; cal_cmds = commands_recal; - n_cal_cmds = ARRAYSIZE(commands_recal); + n_cal_cmds = ARRAY_SIZE(commands_recal); command_nums = command_nums_recal; break; default: @@ -1977,12 +1977,12 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL, (const void *) lcnphy_iqcal_loft_gainladder, - ARRAYSIZE(lcnphy_iqcal_loft_gainladder), + ARRAY_SIZE(lcnphy_iqcal_loft_gainladder), 16, 0); wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL, (const void *)lcnphy_iqcal_ir_gainladder, - ARRAYSIZE(lcnphy_iqcal_ir_gainladder), 16, + ARRAY_SIZE(lcnphy_iqcal_ir_gainladder), 16, 32); if (pi->phy_tx_tone_freq) { @@ -2029,10 +2029,10 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, wlc_lcnphy_common_read_table(pi, LCNPHY_TBL_ID_IQLOCAL, best_coeffs, - ARRAYSIZE(best_coeffs), 16, 96); + ARRAY_SIZE(best_coeffs), 16, 96); wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL, best_coeffs, - ARRAYSIZE(best_coeffs), 16, 64); + ARRAY_SIZE(best_coeffs), 16, 64); if ((cal_type == 3) || (cal_type == 4)) { wlc_lcnphy_common_write_table(pi, LCNPHY_TBL_ID_IQLOCAL, @@ -2041,7 +2041,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, wlc_lcnphy_common_read_table(pi, LCNPHY_TBL_ID_IQLOCAL, pi_lcn->lcnphy_cal_results. txiqlocal_bestcoeffs, - ARRAYSIZE(pi_lcn-> + ARRAY_SIZE(pi_lcn-> lcnphy_cal_results. txiqlocal_bestcoeffs), 16, 96); @@ -2050,7 +2050,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, wlc_lcnphy_common_read_table(pi, LCNPHY_TBL_ID_IQLOCAL, pi_lcn->lcnphy_cal_results. txiqlocal_bestcoeffs, - ARRAYSIZE(pi_lcn->lcnphy_cal_results. + ARRAY_SIZE(pi_lcn->lcnphy_cal_results. txiqlocal_bestcoeffs), 16, 96); pi_lcn->lcnphy_cal_results.txiqlocal_bestcoeffs_valid = TRUE; @@ -2759,7 +2759,7 @@ wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val, do { bw = phy_bw * 1000 * k; num_samps = bw / ABS(f_kHz); - ASSERT(num_samps <= ARRAYSIZE(data_buf)); + ASSERT(num_samps <= ARRAY_SIZE(data_buf)); k++; } while ((num_samps * (u32) (ABS(f_kHz))) != bw); } else @@ -3510,7 +3510,7 @@ static void wlc_lcnphy_periodic_cal(phy_info_t *pi) wlc_lcnphy_txpwrtbl_iqlo_cal(pi); rx_iqcomp = lcnphy_rx_iqcomp_table_rev0; - rx_iqcomp_sz = ARRAYSIZE(lcnphy_rx_iqcomp_table_rev0); + rx_iqcomp_sz = ARRAY_SIZE(lcnphy_rx_iqcomp_table_rev0); if (LCNREV_IS(pi->pubpi.phy_rev, 1)) wlc_lcnphy_rx_iq_cal(pi, NULL, 0, TRUE, FALSE, 1, 40); @@ -4891,11 +4891,11 @@ wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi, u8 channel) } if (CHSPEC_IS2G(pi->radio_chanspec)) { - for (i = 0; i < ARRAYSIZE(chan_info_2064_lcnphy); i++) + for (i = 0; i < ARRAY_SIZE(chan_info_2064_lcnphy); i++) if (chan_info_2064_lcnphy[i].chan == channel) break; - if (i >= ARRAYSIZE(chan_info_2064_lcnphy)) { + if (i >= ARRAY_SIZE(chan_info_2064_lcnphy)) { return; } diff --git a/drivers/staging/brcm80211/phy/wlc_phy_n.c b/drivers/staging/brcm80211/phy/wlc_phy_n.c index 93df7840ed7..638d0aa5156 100644 --- a/drivers/staging/brcm80211/phy/wlc_phy_n.c +++ b/drivers/staging/brcm80211/phy/wlc_phy_n.c @@ -15073,10 +15073,10 @@ void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask) if (NREV_GE(pi->pubpi.phy_rev, 3)) { if (pi->rx2tx_biasentry == -1) { wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_RFSEQ, - ARRAYSIZE(tbl_buf), 80, + ARRAY_SIZE(tbl_buf), 80, 16, tbl_buf); - for (i = 0; i < ARRAYSIZE(tbl_buf); i++) { + for (i = 0; i < ARRAY_SIZE(tbl_buf); i++) { if (tbl_buf[i] == NPHY_REV3_RFSEQ_CMD_CLR_RXRX_BIAS) { @@ -16244,7 +16244,7 @@ static void wlc_phy_workarounds_nphy(phy_info_t *pi) (pi->sh->boardtype == 0x8b)) { uint i; u8 war_dlys[] = { 1, 6, 6, 2, 4, 20, 1 }; - for (i = 0; i < ARRAYSIZE(rfseq_rx2tx_dlys); i++) + for (i = 0; i < ARRAY_SIZE(rfseq_rx2tx_dlys); i++) rfseq_rx2tx_dlys[i] = war_dlys[i]; } @@ -17638,7 +17638,7 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, if (NREV_IS(pi->pubpi.phy_rev, 7)) { chan_info_tbl_p_0 = chan_info_nphyrev7_2057_rev4; - tbl_len = ARRAYSIZE(chan_info_nphyrev7_2057_rev4); + tbl_len = ARRAY_SIZE(chan_info_nphyrev7_2057_rev4); } else if (NREV_IS(pi->pubpi.phy_rev, 8) || NREV_IS(pi->pubpi.phy_rev, 9)) { @@ -17651,7 +17651,7 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, chan_info_tbl_p_2 = chan_info_nphyrev8_2057_rev5; tbl_len = - ARRAYSIZE + ARRAY_SIZE (chan_info_nphyrev8_2057_rev5); } else if (pi->pubpi.radiover == 0x1) { @@ -17659,7 +17659,7 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, chan_info_tbl_p_2 = chan_info_nphyrev9_2057_rev5v1; tbl_len = - ARRAYSIZE + ARRAY_SIZE (chan_info_nphyrev9_2057_rev5v1); } @@ -17669,14 +17669,14 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, chan_info_tbl_p_0 = chan_info_nphyrev8_2057_rev7; tbl_len = - ARRAYSIZE(chan_info_nphyrev8_2057_rev7); + ARRAY_SIZE(chan_info_nphyrev8_2057_rev7); break; case 8: chan_info_tbl_p_0 = chan_info_nphyrev8_2057_rev8; tbl_len = - ARRAYSIZE(chan_info_nphyrev8_2057_rev8); + ARRAY_SIZE(chan_info_nphyrev8_2057_rev8); break; default: @@ -17688,7 +17688,7 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, } else if (NREV_IS(pi->pubpi.phy_rev, 16)) { chan_info_tbl_p_0 = chan_info_nphyrev8_2057_rev8; - tbl_len = ARRAYSIZE(chan_info_nphyrev8_2057_rev8); + tbl_len = ARRAY_SIZE(chan_info_nphyrev8_2057_rev8); } else { goto fail; } @@ -17720,34 +17720,34 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, } else if (NREV_GE(pi->pubpi.phy_rev, 3)) { if (NREV_IS(pi->pubpi.phy_rev, 3)) { chan_info_tbl_p_1 = chan_info_nphyrev3_2056; - tbl_len = ARRAYSIZE(chan_info_nphyrev3_2056); + tbl_len = ARRAY_SIZE(chan_info_nphyrev3_2056); } else if (NREV_IS(pi->pubpi.phy_rev, 4)) { chan_info_tbl_p_1 = chan_info_nphyrev4_2056_A1; - tbl_len = ARRAYSIZE(chan_info_nphyrev4_2056_A1); + tbl_len = ARRAY_SIZE(chan_info_nphyrev4_2056_A1); } else if (NREV_IS(pi->pubpi.phy_rev, 5) || NREV_IS(pi->pubpi.phy_rev, 6)) { switch (pi->pubpi.radiorev) { case 5: chan_info_tbl_p_1 = chan_info_nphyrev5_2056v5; - tbl_len = ARRAYSIZE(chan_info_nphyrev5_2056v5); + tbl_len = ARRAY_SIZE(chan_info_nphyrev5_2056v5); break; case 6: chan_info_tbl_p_1 = chan_info_nphyrev6_2056v6; - tbl_len = ARRAYSIZE(chan_info_nphyrev6_2056v6); + tbl_len = ARRAY_SIZE(chan_info_nphyrev6_2056v6); break; case 7: case 9: chan_info_tbl_p_1 = chan_info_nphyrev5n6_2056v7; tbl_len = - ARRAYSIZE(chan_info_nphyrev5n6_2056v7); + ARRAY_SIZE(chan_info_nphyrev5n6_2056v7); break; case 8: chan_info_tbl_p_1 = chan_info_nphyrev6_2056v8; - tbl_len = ARRAYSIZE(chan_info_nphyrev6_2056v8); + tbl_len = ARRAY_SIZE(chan_info_nphyrev6_2056v8); break; case 11: chan_info_tbl_p_1 = chan_info_nphyrev6_2056v11; - tbl_len = ARRAYSIZE(chan_info_nphyrev6_2056v11); + tbl_len = ARRAY_SIZE(chan_info_nphyrev6_2056v11); break; default: if (NORADIO_ENAB(pi->pubpi)) { @@ -17770,12 +17770,12 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f, freq = chan_info_tbl_p_1[i].freq; } else { - for (i = 0; i < ARRAYSIZE(chan_info_nphy_2055); i++) + for (i = 0; i < ARRAY_SIZE(chan_info_nphy_2055); i++) if (chan_info_nphy_2055[i].chan == channel) break; - if (i >= ARRAYSIZE(chan_info_nphy_2055)) { - ASSERT(i < ARRAYSIZE(chan_info_nphy_2055)); + if (i >= ARRAY_SIZE(chan_info_nphy_2055)) { + ASSERT(i < ARRAY_SIZE(chan_info_nphy_2055)); goto fail; } *t3 = &chan_info_nphy_2055[i]; @@ -24212,20 +24212,20 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, if (phy_bw == 40) { tbl_ptr = tbl_tx_iqlo_cal_loft_ladder_40; - tbl_len = ARRAYSIZE(tbl_tx_iqlo_cal_loft_ladder_40); + tbl_len = ARRAY_SIZE(tbl_tx_iqlo_cal_loft_ladder_40); } else { tbl_ptr = tbl_tx_iqlo_cal_loft_ladder_20; - tbl_len = ARRAYSIZE(tbl_tx_iqlo_cal_loft_ladder_20); + tbl_len = ARRAY_SIZE(tbl_tx_iqlo_cal_loft_ladder_20); } wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, tbl_len, 0, 16, tbl_ptr); if (phy_bw == 40) { tbl_ptr = tbl_tx_iqlo_cal_iqimb_ladder_40; - tbl_len = ARRAYSIZE(tbl_tx_iqlo_cal_iqimb_ladder_40); + tbl_len = ARRAY_SIZE(tbl_tx_iqlo_cal_iqimb_ladder_40); } else { tbl_ptr = tbl_tx_iqlo_cal_iqimb_ladder_20; - tbl_len = ARRAYSIZE(tbl_tx_iqlo_cal_iqimb_ladder_20); + tbl_len = ARRAY_SIZE(tbl_tx_iqlo_cal_iqimb_ladder_20); } wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, tbl_len, 32, 16, tbl_ptr); @@ -24252,7 +24252,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, if (pi->mphase_cal_phase_id > MPHASE_CAL_STATE_TXPHASE0) { tbl_ptr = pi->mphase_txcal_bestcoeffs; - tbl_len = ARRAYSIZE(pi->mphase_txcal_bestcoeffs); + tbl_len = ARRAY_SIZE(pi->mphase_txcal_bestcoeffs); if (NREV_LT(pi->pubpi.phy_rev, 3)) { tbl_len -= 2; @@ -24261,7 +24261,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, if ((!fullcal) && (pi->nphy_txiqlocal_coeffsvalid)) { tbl_ptr = pi->nphy_txiqlocal_bestc; - tbl_len = ARRAYSIZE(pi->nphy_txiqlocal_bestc); + tbl_len = ARRAY_SIZE(pi->nphy_txiqlocal_bestc); if (NREV_LT(pi->pubpi.phy_rev, 3)) { tbl_len -= 2; @@ -24274,12 +24274,12 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, tbl_ptr = tbl_tx_iqlo_cal_startcoefs_nphyrev3; tbl_len = - ARRAYSIZE + ARRAY_SIZE (tbl_tx_iqlo_cal_startcoefs_nphyrev3); } else { tbl_ptr = tbl_tx_iqlo_cal_startcoefs; tbl_len = - ARRAYSIZE + ARRAY_SIZE (tbl_tx_iqlo_cal_startcoefs); } } @@ -24289,12 +24289,12 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, if (fullcal) { max_cal_cmds = (NREV_GE(pi->pubpi.phy_rev, 3)) ? - ARRAYSIZE(tbl_tx_iqlo_cal_cmds_fullcal_nphyrev3) : - ARRAYSIZE(tbl_tx_iqlo_cal_cmds_fullcal); + ARRAY_SIZE(tbl_tx_iqlo_cal_cmds_fullcal_nphyrev3) : + ARRAY_SIZE(tbl_tx_iqlo_cal_cmds_fullcal); } else { max_cal_cmds = (NREV_GE(pi->pubpi.phy_rev, 3)) ? - ARRAYSIZE(tbl_tx_iqlo_cal_cmds_recal_nphyrev3) : - ARRAYSIZE(tbl_tx_iqlo_cal_cmds_recal); + ARRAY_SIZE(tbl_tx_iqlo_cal_cmds_recal_nphyrev3) : + ARRAY_SIZE(tbl_tx_iqlo_cal_cmds_recal); } if (mphase) { @@ -24414,7 +24414,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_IQLOCAL, 2, 93, 16, tbl_buf); - tbl_len = ARRAYSIZE(pi->nphy_txiqlocal_bestc); + tbl_len = ARRAY_SIZE(pi->nphy_txiqlocal_bestc); if (NREV_LT(pi->pubpi.phy_rev, 3)) { tbl_len -= 2; @@ -24426,7 +24426,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain, pi->nphy_txiqlocal_coeffsvalid = TRUE; pi->nphy_txiqlocal_chanspec = pi->radio_chanspec; } else { - tbl_len = ARRAYSIZE(pi->mphase_txcal_bestcoeffs); + tbl_len = ARRAY_SIZE(pi->mphase_txcal_bestcoeffs); if (NREV_LT(pi->pubpi.phy_rev, 3)) { tbl_len -= 2; @@ -24473,7 +24473,7 @@ static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi) if ((pi->nphy_txiqlocal_chanspec == pi->radio_chanspec) && (pi->nphy_txiqlocal_coeffsvalid)) { wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL, - ARRAYSIZE(tbl_buf), 80, 16, tbl_buf); + ARRAY_SIZE(tbl_buf), 80, 16, tbl_buf); if ((pi->nphy_txiqlocal_bestc[0] != tbl_buf[0]) || (pi->nphy_txiqlocal_bestc[1] != tbl_buf[1]) || diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c index 33c03f40213..871ee99ee4a 100644 --- a/drivers/staging/brcm80211/sys/wlc_bmac.c +++ b/drivers/staging/brcm80211/sys/wlc_bmac.c @@ -926,7 +926,7 @@ BCMATTACHFN(wlc_bmac_attach) (wlc_info_t *wlc, u16 vendor, u16 device, /* init tx fifo size */ ASSERT((wlc_hw->corerev - XMTFIFOTBL_STARTREV) < - ARRAYSIZE(xmtfifo_sz)); + ARRAY_SIZE(xmtfifo_sz)); wlc_hw->xmtfifo_sz = xmtfifo_sz[(wlc_hw->corerev - XMTFIFOTBL_STARTREV)]; @@ -1500,7 +1500,7 @@ wlc_bmac_mhf(wlc_hw_info_t *wlc_hw, u8 idx, u16 mask, u16 val, ASSERT((val & ~mask) == 0); ASSERT(idx < MHFMAX); - ASSERT(ARRAYSIZE(addr) == MHFMAX); + ASSERT(ARRAY_SIZE(addr) == MHFMAX); switch (bands) { /* Current band only or all bands, @@ -1576,7 +1576,7 @@ static void wlc_write_mhf(wlc_hw_info_t *wlc_hw, u16 *mhfs) M_HOST_FLAGS5 }; - ASSERT(ARRAYSIZE(addr) == MHFMAX); + ASSERT(ARRAY_SIZE(addr) == MHFMAX); for (idx = 0; idx < MHFMAX; idx++) { wlc_bmac_write_shm(wlc_hw, addr[idx], mhfs[idx]); @@ -3595,7 +3595,7 @@ static void wlc_upd_ofdm_pctl1_table(wlc_hw_info_t *wlc_hw) return; /* walk the phy rate table and update the entries */ - for (i = 0; i < ARRAYSIZE(rates); i++) { + for (i = 0; i < ARRAY_SIZE(rates); i++) { rate = rates[i]; entry_ptr = wlc_bmac_ofdm_ratetable_offset(wlc_hw, rate); @@ -3634,7 +3634,7 @@ static u16 wlc_bmac_ofdm_ratetable_offset(wlc_hw_info_t *wlc_hw, u8 rate) {WLC_RATE_54M, 0xC} }; - for (i = 0; i < ARRAYSIZE(rate_lookup); i++) { + for (i = 0; i < ARRAY_SIZE(rate_lookup); i++) { if (rate == rate_lookup[i].rate) { plcp_rate = rate_lookup[i].signal_rate; break; diff --git a/drivers/staging/brcm80211/sys/wlc_channel.c b/drivers/staging/brcm80211/sys/wlc_channel.c index a408bf6f109..1c3c043afbd 100644 --- a/drivers/staging/brcm80211/sys/wlc_channel.c +++ b/drivers/staging/brcm80211/sys/wlc_channel.c @@ -380,7 +380,7 @@ void wlc_locale_get_channels(const locale_info_t *locale, chanvec_t *channels) bzero(channels, sizeof(chanvec_t)); - for (i = 0; i < ARRAYSIZE(g_table_locale_base); i++) { + for (i = 0; i < ARRAY_SIZE(g_table_locale_base); i++) { if (locale->valid_channels & (1 << i)) { wlc_locale_add_channels(channels, g_table_locale_base[i]); @@ -562,10 +562,10 @@ struct chan20_info chan20_info[] = { const locale_info_t *wlc_get_locale_2g(u8 locale_idx) { - if (locale_idx >= ARRAYSIZE(g_locale_2g_table)) { + if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) { WL_ERROR(("%s: locale 2g index size out of range %d\n", __func__, locale_idx)); - ASSERT(locale_idx < ARRAYSIZE(g_locale_2g_table)); + ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table)); return NULL; } return g_locale_2g_table[locale_idx]; @@ -573,10 +573,10 @@ const locale_info_t *wlc_get_locale_2g(u8 locale_idx) const locale_info_t *wlc_get_locale_5g(u8 locale_idx) { - if (locale_idx >= ARRAYSIZE(g_locale_5g_table)) { + if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) { WL_ERROR(("%s: locale 5g index size out of range %d\n", __func__, locale_idx)); - ASSERT(locale_idx < ARRAYSIZE(g_locale_5g_table)); + ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table)); return NULL; } return g_locale_5g_table[locale_idx]; @@ -584,7 +584,7 @@ const locale_info_t *wlc_get_locale_5g(u8 locale_idx) const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx) { - if (locale_idx >= ARRAYSIZE(g_mimo_2g_table)) { + if (locale_idx >= ARRAY_SIZE(g_mimo_2g_table)) { WL_ERROR(("%s: mimo 2g index size out of range %d\n", __func__, locale_idx)); return NULL; @@ -594,7 +594,7 @@ const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx) const locale_mimo_info_t *wlc_get_mimo_5g(u8 locale_idx) { - if (locale_idx >= ARRAYSIZE(g_mimo_5g_table)) { + if (locale_idx >= ARRAY_SIZE(g_mimo_5g_table)) { WL_ERROR(("%s: mimo 5g index size out of range %d\n", __func__, locale_idx)); return NULL; @@ -886,7 +886,7 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode, return NULL; /* find matched table entry from country code */ - size = ARRAYSIZE(cntry_locales); + size = ARRAY_SIZE(cntry_locales); for (i = 0; i < size; i++) { if (strcmp(ccode, cntry_locales[i].abbrev) == 0) { return &cntry_locales[i].country; diff --git a/drivers/staging/brcm80211/util/hndpmu.c b/drivers/staging/brcm80211/util/hndpmu.c index 97daf1dab80..c169c92d09a 100644 --- a/drivers/staging/brcm80211/util/hndpmu.c +++ b/drivers/staging/brcm80211/util/hndpmu.c @@ -707,11 +707,11 @@ void BCMATTACHFN(si_pmu_res_init) (si_t *sih, osl_t *osh) pmu_res_updown_table_sz = 0; } else { pmu_res_updown_table = bcm4329_res_updown; - pmu_res_updown_table_sz = ARRAYSIZE(bcm4329_res_updown); + pmu_res_updown_table_sz = ARRAY_SIZE(bcm4329_res_updown); } /* Optimize resources dependencies */ pmu_res_depend_table = bcm4329_res_depend; - pmu_res_depend_table_sz = ARRAYSIZE(bcm4329_res_depend); + pmu_res_depend_table_sz = ARRAY_SIZE(bcm4329_res_depend); break; case BCM4319_CHIP_ID: @@ -719,15 +719,15 @@ void BCMATTACHFN(si_pmu_res_init) (si_t *sih, osl_t *osh) if (ISSIM_ENAB(sih)) { pmu_res_updown_table = bcm4319a0_res_updown_qt; pmu_res_updown_table_sz = - ARRAYSIZE(bcm4319a0_res_updown_qt); + ARRAY_SIZE(bcm4319a0_res_updown_qt); } else { pmu_res_updown_table = bcm4319a0_res_updown; pmu_res_updown_table_sz = - ARRAYSIZE(bcm4319a0_res_updown); + ARRAY_SIZE(bcm4319a0_res_updown); } /* Optimize resources dependancies masks */ pmu_res_depend_table = bcm4319a0_res_depend; - pmu_res_depend_table_sz = ARRAYSIZE(bcm4319a0_res_depend); + pmu_res_depend_table_sz = ARRAY_SIZE(bcm4319a0_res_depend); break; case BCM4336_CHIP_ID: @@ -735,15 +735,15 @@ void BCMATTACHFN(si_pmu_res_init) (si_t *sih, osl_t *osh) if (ISSIM_ENAB(sih)) { pmu_res_updown_table = bcm4336a0_res_updown_qt; pmu_res_updown_table_sz = - ARRAYSIZE(bcm4336a0_res_updown_qt); + ARRAY_SIZE(bcm4336a0_res_updown_qt); } else { pmu_res_updown_table = bcm4336a0_res_updown; pmu_res_updown_table_sz = - ARRAYSIZE(bcm4336a0_res_updown); + ARRAY_SIZE(bcm4336a0_res_updown); } /* Optimize resources dependancies masks */ pmu_res_depend_table = bcm4336a0_res_depend; - pmu_res_depend_table_sz = ARRAYSIZE(bcm4336a0_res_depend); + pmu_res_depend_table_sz = ARRAY_SIZE(bcm4336a0_res_depend); break; case BCM4330_CHIP_ID: @@ -751,15 +751,15 @@ void BCMATTACHFN(si_pmu_res_init) (si_t *sih, osl_t *osh) if (ISSIM_ENAB(sih)) { pmu_res_updown_table = bcm4330a0_res_updown_qt; pmu_res_updown_table_sz = - ARRAYSIZE(bcm4330a0_res_updown_qt); + ARRAY_SIZE(bcm4330a0_res_updown_qt); } else { pmu_res_updown_table = bcm4330a0_res_updown; pmu_res_updown_table_sz = - ARRAYSIZE(bcm4330a0_res_updown); + ARRAY_SIZE(bcm4330a0_res_updown); } /* Optimize resources dependancies masks */ pmu_res_depend_table = bcm4330a0_res_depend; - pmu_res_depend_table_sz = ARRAYSIZE(bcm4330a0_res_depend); + pmu_res_depend_table_sz = ARRAY_SIZE(bcm4330a0_res_depend); break; default: diff --git a/drivers/staging/brcm80211/util/linux_osl.c b/drivers/staging/brcm80211/util/linux_osl.c index e7a948257d5..62299ca0810 100644 --- a/drivers/staging/brcm80211/util/linux_osl.c +++ b/drivers/staging/brcm80211/util/linux_osl.c @@ -154,7 +154,7 @@ osl_t *osl_attach(void *pdev, uint bustype, bool pkttag) #ifdef BRCM_FULLMAC /* Check that error map has the right number of entries in it */ - ASSERT(ABS(BCME_LAST) == (ARRAYSIZE(linuxbcmerrormap) - 1)); + ASSERT(ABS(BCME_LAST) == (ARRAY_SIZE(linuxbcmerrormap) - 1)); #endif /* BRCM_FULLMAC */ osh->magic = OS_HANDLE_MAGIC;