s/bzero/memset/g Signed-off-by: Brett Rudley <brudley@xxxxxxxxxxxx> --- drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 +- .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 2 +- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 8 ++-- drivers/staging/brcm80211/brcmfmac/wl_iw.c | 24 +++++----- drivers/staging/brcm80211/include/linux_osl.h | 3 - drivers/staging/brcm80211/phy/wlc_phy_cmn.c | 16 +++--- drivers/staging/brcm80211/phy/wlc_phy_lcn.c | 6 +- drivers/staging/brcm80211/sys/wl_mac80211.c | 8 ++-- drivers/staging/brcm80211/sys/wlc_ampdu.c | 6 +- drivers/staging/brcm80211/sys/wlc_bmac.c | 2 +- drivers/staging/brcm80211/sys/wlc_channel.c | 10 ++-- drivers/staging/brcm80211/sys/wlc_mac80211.c | 48 ++++++++++--------- drivers/staging/brcm80211/sys/wlc_rate.c | 2 +- drivers/staging/brcm80211/util/bcmotp.c | 2 +- drivers/staging/brcm80211/util/bcmsrom.c | 2 +- drivers/staging/brcm80211/util/bcmutils.c | 2 +- drivers/staging/brcm80211/util/hnddma.c | 13 +++-- drivers/staging/brcm80211/util/linux_osl.c | 2 +- drivers/staging/brcm80211/util/siutils.c | 4 +- 19 files changed, 82 insertions(+), 80 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c index aadfe69..2e02d5e 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c @@ -751,7 +751,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length) sd_trace(("%s: Func = %d\n", __func__, func)); if (!sd->func_cis_ptr[func]) { - bzero(cis, length); + memset(cis, 0, length); sd_err(("%s: no func_cis_ptr[%d]\n", __func__, func)); return SDIOH_API_RC_FAIL; } diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c index 14f73fd..ceaa474 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c @@ -213,7 +213,7 @@ int sdio_function_init(void) if (!gInstance) return -ENOMEM; - bzero(&sdmmc_dev, sizeof(sdmmc_dev)); + memset(&sdmmc_dev, 0, sizeof(sdmmc_dev)); error = sdio_register_driver(&bcmsdh_sdmmc_driver); return error; diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index 9e96c7e..6b41d1f 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c @@ -960,7 +960,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, frame = (u8 *) (pkt->data); ASSERT((pad + SDPCM_HDRLEN) <= (int)(pkt->len)); - bzero(frame, pad + SDPCM_HDRLEN); + memset(frame, 0, pad + SDPCM_HDRLEN); } } ASSERT(pad < DHD_SDALIGN); @@ -1252,7 +1252,7 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen) frame -= doff; len += doff; msglen += doff; - bzero(frame, doff + SDPCM_HDRLEN); + memset(frame, 0, doff + SDPCM_HDRLEN); } ASSERT(doff < DHD_SDALIGN); } @@ -2536,7 +2536,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus) if (!vbuffer) return BCME_NOMEM; - bzero(vbuffer, varsize); + memset(vbuffer, 0, varsize); bcopy(bus->vars, vbuffer, bus->varsz); /* Write the vars list */ @@ -5285,7 +5285,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, struct osl_info *osh, void *sdh, "failed\n", fn)); break; } - bzero(cis[fn], SBSDIO_CIS_SIZE_LIMIT); + memset(cis[fn], 0, SBSDIO_CIS_SIZE_LIMIT); err = bcmsdh_cis_read(sdh, fn, cis[fn], SBSDIO_CIS_SIZE_LIMIT); diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index e714d6a..8bf24c7 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c @@ -347,10 +347,10 @@ wl_iw_config_commit(struct net_device *dev, if (!ssid.SSID_len) return 0; - bzero(&bssid, sizeof(struct sockaddr)); + memset(&bssid, 0, sizeof(struct sockaddr)); error = dev_wlc_ioctl(dev, WLC_REASSOC, &bssid, ETHER_ADDR_LEN); if (error) { - WL_ERROR(("%s: WLC_REASSOC to %s failed \n", __func__, + WL_ERROR(("%s: WLC_REASSOC to %s failed\n", __func__, ssid.SSID)); return error; } @@ -775,7 +775,7 @@ wl_iw_set_wap(struct net_device *dev, if (ETHER_ISBCAST(awrq->sa_data) || ETHER_ISNULLADDR(awrq->sa_data)) { scb_val_t scbval; - bzero(&scbval, sizeof(scb_val_t)); + memset(&scbval, 0, sizeof(scb_val_t)); (void)dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t)); return 0; @@ -2412,7 +2412,7 @@ wl_iw_get_encode(struct net_device *dev, WL_TRACE(("%s: SIOCGIWENCODE\n", dev->name)); - bzero(&key, sizeof(wl_wsec_key_t)); + memset(&key, 0, sizeof(wl_wsec_key_t)); if ((dwrq->flags & IW_ENCODE_INDEX) == 0) { for (key.index = 0; key.index < DOT11_MAX_DEFAULT_KEYS; @@ -2647,7 +2647,7 @@ wl_iw_set_pmksa(struct net_device *dev, if (iwpmksa->cmd == IW_PMKSA_FLUSH) { WL_WSEC(("wl_iw_set_pmksa - IW_PMKSA_FLUSH\n")); - bzero((char *)&pmkid_list, sizeof(pmkid_list)); + memset((char *)&pmkid_list, 0, sizeof(pmkid_list)); } else if (iwpmksa->cmd == IW_PMKSA_REMOVE) { @@ -2676,7 +2676,7 @@ wl_iw_set_pmksa(struct net_device *dev, if ((pmkid_list.pmkids.npmkid > 0) && (i < pmkid_list.pmkids.npmkid)) { - bzero(&pmkid_list.pmkids.pmkid[i], sizeof(pmkid_t)); + memset(&pmkid_list.pmkids.pmkid[i], 0, sizeof(pmkid_t)); for (; i < (pmkid_list.pmkids.npmkid - 1); i++) { bcopy(&pmkid_list.pmkids.pmkid[i + 1].BSSID, &pmkid_list.pmkids.pmkid[i].BSSID, @@ -3409,16 +3409,16 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data) case WLC_E_DEAUTH_IND: case WLC_E_DISASSOC_IND: cmd = SIOCGIWAP; - bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN); + memset(wrqu.addr.sa_data, 0, ETHER_ADDR_LEN); wrqu.addr.sa_family = ARPHRD_ETHER; - bzero(&extra, ETHER_ADDR_LEN); + memset(&extra, 0, ETHER_ADDR_LEN); break; case WLC_E_LINK: case WLC_E_NDIS_LINK: cmd = SIOCGIWAP; if (!(flags & WLC_EVENT_MSG_LINK)) { - bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN); - bzero(&extra, ETHER_ADDR_LEN); + memset(wrqu.addr.sa_data, 0, ETHER_ADDR_LEN); + memset(&extra, 0, ETHER_ADDR_LEN); WAKE_LOCK_TIMEOUT(iw->pub, WAKE_LOCK_LINK_DOWN_TMOUT, 20 * HZ); } else { @@ -3488,7 +3488,7 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data) wrqu.data.length = sizeof(struct iw_pmkid_cand); pmkidcand = pmkcandlist->pmkid_cand; while (count) { - bzero(iwpmkidcand, + memset(iwpmkidcand, 0, sizeof(struct iw_pmkid_cand)); if (pmkidcand->preauth) iwpmkidcand->flags |= @@ -3586,7 +3586,7 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats) phy_noise = dtoh32(phy_noise); WL_TRACE(("wl_iw_get_wireless_stats phy noise=%d\n", phy_noise)); - bzero(&scb_val, sizeof(scb_val_t)); + memset(&scb_val, 0, sizeof(scb_val_t)); res = dev_wlc_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t)); if (res) goto done; diff --git a/drivers/staging/brcm80211/include/linux_osl.h b/drivers/staging/brcm80211/include/linux_osl.h index 94f5d12..ec1c511 100644 --- a/drivers/staging/brcm80211/include/linux_osl.h +++ b/drivers/staging/brcm80211/include/linux_osl.h @@ -102,7 +102,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, /* bcopy's: Linux kernel doesn't provide these (anymore) */ #define bcopy(src, dst, len) memcpy((dst), (src), (len)) #define bcmp(b1, b2, len) memcmp((b1), (b2), (len)) -#define bzero(b, len) memset((b), '\0', (len)) /* register access macros */ #if defined(OSLREGOPS) @@ -201,10 +200,8 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v)) #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v)) -/* bcopy, bcmp, and bzero functions */ #define bcopy(src, dst, len) memcpy((dst), (src), (len)) #define bcmp(b1, b2, len) memcmp((b1), (b2), (len)) -#define bzero(b, len) memset((b), '\0', (len)) /* uncached/cached virtual address */ #ifdef __mips__ diff --git a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c index 87d33dd..6ea4df6 100644 --- a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c +++ b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c @@ -1538,7 +1538,7 @@ wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels) ASSERT((band == WLC_BAND_2G) || (band == WLC_BAND_5G)); - bzero(channels, sizeof(chanvec_t)); + memset(channels, 0, sizeof(chanvec_t)); for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) { channel = chan_info_all[i].chan; @@ -1900,7 +1900,7 @@ void wlc_phy_txpower_recalc_target(phy_info_t *pi) tx_pwr_min = min(tx_pwr_min, tx_pwr_target[rate]); } - bzero(pi->tx_power_offset, sizeof(pi->tx_power_offset)); + memset(pi->tx_power_offset, 0, sizeof(pi->tx_power_offset)); pi->tx_power_max = tx_pwr_max; pi->tx_power_min = tx_pwr_min; pi->tx_power_max_rate_ind = tx_pwr_max_rate_ind; @@ -2511,7 +2511,7 @@ wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant) s8 cmplx_pwr_dbm[PHY_CORE_MAX]; u8 i; - bzero((u8 *) cmplx_pwr_dbm, sizeof(cmplx_pwr_dbm)); + memset((u8 *) cmplx_pwr_dbm, 0, sizeof(cmplx_pwr_dbm)); ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX); wlc_phy_compute_dB(cmplx_pwr, cmplx_pwr_dbm, pi->pubpi.phy_corenum); @@ -2625,9 +2625,9 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch) u8 wait_crs = 0; u8 i; - bzero((u8 *) est, sizeof(est)); - bzero((u8 *) cmplx_pwr, sizeof(cmplx_pwr)); - bzero((u8 *) noise_dbm_ant, sizeof(noise_dbm_ant)); + memset((u8 *) est, 0, sizeof(est)); + memset((u8 *) cmplx_pwr, 0, sizeof(cmplx_pwr)); + memset((u8 *) noise_dbm_ant, 0, sizeof(noise_dbm_ant)); log_num_samps = PHY_NOISE_SAMPLE_LOG_NUM_NPHY; num_samps = 1 << log_num_samps; @@ -2708,8 +2708,8 @@ static s8 wlc_phy_noise_read_shmem(phy_info_t *pi) u8 idx, core; ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX); - bzero((u8 *) cmplx_pwr, sizeof(cmplx_pwr)); - bzero((u8 *) noise_dbm_ant, sizeof(noise_dbm_ant)); + memset((u8 *) cmplx_pwr, 0, sizeof(cmplx_pwr)); + memset((u8 *) noise_dbm_ant, 0, sizeof(noise_dbm_ant)); for (idx = 0, core = 0; core < pi->pubpi.phy_corenum; idx += 2, core++) { lo = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP(idx)); diff --git a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c index 1fde9d5..9492ca5 100644 --- a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c +++ b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c @@ -1331,7 +1331,7 @@ static void wlc_lcnphy_clear_tx_power_offsets(phy_info_t *pi) u32 data_buf[64]; phytbl_info_t tab; - bzero(data_buf, sizeof(data_buf)); + memset(data_buf, 0, sizeof(data_buf)); tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL; tab.tbl_width = 32; @@ -1955,7 +1955,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi, band_idx = (CHSPEC_IS5G(pi->radio_chanspec) ? 1 : 0); cal_gains = *target_gains; - bzero(ncorr_override, sizeof(ncorr_override)); + memset(ncorr_override, 0, sizeof(ncorr_override)); for (j = 0; j < iqcal_gainparams_numgains_lcnphy[band_idx]; j++) { if (hash == tbl_iqcal_gainparams_lcnphy[band_idx][j][0]) { cal_gains.gm_gain = @@ -2533,7 +2533,7 @@ static void wlc_lcnphy_clear_papd_comptable(phy_info_t *pi) tab.tbl_width = 32; tab.tbl_offset = 0; - bzero(temp_offset, sizeof(temp_offset)); + memset(temp_offset, 0, sizeof(temp_offset)); for (j = 1; j < 128; j += 2) temp_offset[j] = 0x80000; diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c index 7d18d4f..959ea52 100644 --- a/drivers/staging/brcm80211/sys/wl_mac80211.c +++ b/drivers/staging/brcm80211/sys/wl_mac80211.c @@ -530,7 +530,7 @@ wl_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, /* Init the scb */ scb = (struct scb *)sta->drv_priv; - bzero(scb, sizeof(struct scb)); + memset(scb, 0, sizeof(struct scb)); for (i = 0; i < NUMPRIO; i++) scb->seqctl[i] = 0xFFFF; scb->seqctl_nonqos = 0xFFFF; @@ -1073,7 +1073,7 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_drvdata(pdev, hw); - bzero(hw->priv, sizeof(*wl)); + memset(hw->priv, 0, sizeof(*wl)); wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, pdev->irq); @@ -1555,7 +1555,7 @@ wl_timer_t *wl_init_timer(wl_info_t *wl, void (*fn) (void *arg), void *arg, return 0; } - bzero(t, sizeof(wl_timer_t)); + memset(t, 0, sizeof(wl_timer_t)); init_timer(&t->timer); t->timer.data = (unsigned long) t; @@ -1747,7 +1747,7 @@ static int wl_request_fw(wl_info_t *wl, struct pci_dev *pdev) char fw_name[100]; int i; - bzero((void *)&wl->fw, sizeof(struct wl_firmware)); + memset((void *)&wl->fw, 0, sizeof(struct wl_firmware)); for (i = 0; i < WL_MAX_FW; i++) { if (wl_firmwares[i] == NULL) break; diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c index c5ab4a4..86563b5 100644 --- a/drivers/staging/brcm80211/sys/wlc_ampdu.c +++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c @@ -976,7 +976,7 @@ wlc_ampdu_dotxstatus_complete(ampdu_info_t *ampdu, struct scb *scb, #ifdef BCMDBG u8 hole[AMPDU_MAX_MPDU]; - bzero(hole, sizeof(hole)); + memset(hole, 0, sizeof(hole)); #endif ASSERT(tx_info->flags & IEEE80211_TX_CTL_AMPDU); @@ -993,7 +993,7 @@ wlc_ampdu_dotxstatus_complete(ampdu_info_t *ampdu, struct scb *scb, ASSERT(ini->scb == scb); - bzero(bitmap, sizeof(bitmap)); + memset(bitmap, 0, sizeof(bitmap)); queue = txs->frameid & TXFID_QUEUE_MASK; ASSERT(queue < AC_COUNT); @@ -1318,7 +1318,7 @@ void wlc_ampdu_macaddr_upd(wlc_info_t *wlc) char template[T_RAM_ACCESS_SZ * 2]; /* driver needs to write the ta in the template; ta is at offset 16 */ - bzero(template, sizeof(template)); + memset(template, 0, sizeof(template)); bcopy((char *)wlc->pub->cur_etheraddr.octet, template, ETHER_ADDR_LEN); wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2), template); diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c index 2245a8b..6711c69 100644 --- a/drivers/staging/brcm80211/sys/wlc_bmac.c +++ b/drivers/staging/brcm80211/sys/wlc_bmac.c @@ -1457,7 +1457,7 @@ wlc_mhfdef(wlc_info_t *wlc, u16 *mhfs, u16 mhf2_init) { wlc_hw_info_t *wlc_hw = wlc->hw; - bzero(mhfs, sizeof(u16) * MHFMAX); + memset(mhfs, 0, MHFMAX * sizeof(u16)); mhfs[MHF2] |= mhf2_init; diff --git a/drivers/staging/brcm80211/sys/wlc_channel.c b/drivers/staging/brcm80211/sys/wlc_channel.c index 2fcdbc7..bb82a8c 100644 --- a/drivers/staging/brcm80211/sys/wlc_channel.c +++ b/drivers/staging/brcm80211/sys/wlc_channel.c @@ -382,7 +382,7 @@ void wlc_locale_get_channels(const locale_info_t *locale, chanvec_t *channels) { u8 i; - bzero(channels, sizeof(chanvec_t)); + memset(channels, 0, sizeof(chanvec_t)); for (i = 0; i < ARRAY_SIZE(g_table_locale_base); i++) { if (locale->valid_channels & (1 << i)) { @@ -634,7 +634,7 @@ wlc_cm_info_t *wlc_channel_mgr_attach(wlc_info_t *wlc) } /* internal country information which must match regulatory constraints in firmware */ - bzero(country_abbrev, WLC_CNTRY_BUF_SZ); + memset(country_abbrev, 0, WLC_CNTRY_BUF_SZ); strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1); country = wlc_country_lookup(wlc, country_abbrev); @@ -763,7 +763,7 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm, /* save current country state */ wlc_cm->country = country; - bzero(&prev_country_abbrev, WLC_CNTRY_BUF_SZ); + memset(&prev_country_abbrev, 0, WLC_CNTRY_BUF_SZ); strncpy(prev_country_abbrev, wlc_cm->country_abbrev, WLC_CNTRY_BUF_SZ - 1); @@ -1008,7 +1008,7 @@ void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm) wlcband_t *band; const chanvec_t *chanvec; - bzero(&wlc_cm->quiet_channels, sizeof(chanvec_t)); + memset(&wlc_cm->quiet_channels, 0, sizeof(chanvec_t)); band = wlc->band; for (i = 0; i < NBANDS(wlc); @@ -1319,7 +1319,7 @@ wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec, int maxpwr_idx; uint j; - bzero(txpwr, sizeof(txpwr_limits_t)); + memset(txpwr, 0, sizeof(txpwr_limits_t)); if (!wlc_valid_chanspec_db(wlc_cm, chanspec)) { country = wlc_country_lookup(wlc, wlc->autocountry_default); diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c index 29b6139..7017db6 100644 --- a/drivers/staging/brcm80211/sys/wlc_mac80211.c +++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c @@ -372,7 +372,8 @@ void wlc_reset(wlc_info_t *wlc) wlc_statsupd(wlc); /* reset our snapshot of macstat counters */ - bzero((char *)wlc->core->macstat_snapshot, sizeof(macstat_t)); + memset((char *)wlc->core->macstat_snapshot, 0, + sizeof(macstat_t)); } wlc_bmac_reset(wlc->hw); @@ -866,7 +867,7 @@ static int wlc_get_current_txpwr(wlc_info_t *wlc, void *pwr, uint len) else if (len < sizeof(tx_power_t)) return BCME_BUFTOOSHORT; - bzero(&power, sizeof(tx_power_t)); + memset(&power, 0, sizeof(tx_power_t)); power.chanspec = WLC_BAND_PI_RADIO_CHANSPEC; if (wlc->pub->associated) @@ -988,7 +989,7 @@ static int wlc_get_current_txpwr(wlc_info_t *wlc, void *pwr, uint len) } else { int band_idx = CHSPEC_IS2G(power.chanspec) ? 0 : 1; - bzero(old_power, sizeof(tx_power_legacy_t)); + memset(old_power, 0, sizeof(tx_power_legacy_t)); old_power->txpwr_local_max = power.local_max; old_power->txpwr_local_constraint = power.local_constraint; @@ -1359,7 +1360,7 @@ void wlc_wme_setparams(wlc_info_t *wlc, u16 aci, void *arg, bool suspend) wlc->wme_admctl = 0; do { - bzero((char *)&acp_shm, sizeof(shm_acparams_t)); + memset((char *)&acp_shm, 0, sizeof(shm_acparams_t)); /* find out which ac this set of params applies to */ ASSERT(aci < AC_COUNT); /* set the admission control policy for this AC */ @@ -1440,7 +1441,7 @@ void wlc_edcf_setparams(wlc_bsscfg_t *cfg, bool suspend) wlc->wme_admctl = 0; for (i = 0; i < AC_COUNT; i++, edcf_acp++) { - bzero((char *)&acp_shm, sizeof(shm_acparams_t)); + memset((char *)&acp_shm, 0, sizeof(shm_acparams_t)); /* find out which ac this set of params applies to */ aci = (edcf_acp->ACI & EDCF_ACI_MASK) >> EDCF_ACI_SHIFT; ASSERT(aci < AC_COUNT); @@ -2633,7 +2634,7 @@ int wlc_up(wlc_info_t *wlc) static void wlc_tx_prec_map_init(wlc_info_t *wlc) { wlc->tx_prec_map = WLC_PREC_BMP_ALL; - bzero(wlc->fifo2prec_map, sizeof(u16) * NFIFO); + memset(wlc->fifo2prec_map, 0, NFIFO * sizeof(u16)); /* For non-WME, both fifos have overlapping MAXPRIO. So just disable all precedences * if either is full. @@ -2790,10 +2791,10 @@ int wlc_set_gmode(wlc_info_t *wlc, u8 gmode, bool config) wlc_protection_upd(wlc, WLC_PROT_G_USER, gmode); /* Clear supported rates filter */ - bzero(&wlc->sup_rates_override, sizeof(wlc_rateset_t)); + memset(&wlc->sup_rates_override, 0, sizeof(wlc_rateset_t)); /* Clear rateset override */ - bzero(&rs, sizeof(wlc_rateset_t)); + memset(&rs, 0, sizeof(wlc_rateset_t)); switch (gmode) { case GMODE_LEGACY_B: @@ -3589,7 +3590,7 @@ _wlc_ioctl(wlc_info_t *wlc, int cmd, void *arg, int len, struct wlc_if *wlcif) break; } - bzero((char *)&key, sizeof(key)); + memset((char *)&key, 0, sizeof(key)); if (src_key) { key.index = src_key->id; key.len = src_key->len; @@ -3686,7 +3687,7 @@ _wlc_ioctl(wlc_info_t *wlc, int cmd, void *arg, int len, struct wlc_if *wlcif) wlc_rateset_t rs; wl_rateset_t *ret_rs = (wl_rateset_t *) arg; - bzero(&rs, sizeof(wlc_rateset_t)); + memset(&rs, 0, sizeof(wlc_rateset_t)); wlc_default_rateset(wlc, (wlc_rateset_t *) &rs); if (len < (int)(rs.count + sizeof(rs.count))) { @@ -3714,7 +3715,7 @@ _wlc_ioctl(wlc_info_t *wlc, int cmd, void *arg, int len, struct wlc_if *wlcif) break; } - bzero(&rs, sizeof(wlc_rateset_t)); + memset(&rs, 0, sizeof(wlc_rateset_t)); /* Copy only legacy rateset section */ rs.count = in_rs->count; @@ -4048,7 +4049,7 @@ _wlc_ioctl(wlc_info_t *wlc, int cmd, void *arg, int len, struct wlc_if *wlcif) /* check for an empty rateset to clear the override */ if (rs.count == 0) { - bzero(&wlc->sup_rates_override, + memset(&wlc->sup_rates_override, 0, sizeof(wlc_rateset_t)); break; } @@ -4349,7 +4350,7 @@ int wlc_module_unregister(wlc_pub_t *pub, const char *name, void *hdl) for (i = 0; i < WLC_MAXMODULES; i++) { if (!strcmp(wlc->modulecb[i].name, name) && (wlc->modulecb[i].hdl == hdl)) { - bzero(&wlc->modulecb[i], sizeof(modulecb_t)); + memset(&wlc->modulecb[i], 0, sizeof(modulecb_t)); return 0; } } @@ -5355,7 +5356,7 @@ wlc_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8 *plcp) rate_signal = rate_info[rate] & RATE_MASK; ASSERT(rate_signal != 0); - bzero(plcp, D11_PHY_HDR_LEN); + memset(plcp, 0, D11_PHY_HDR_LEN); D11A_PHY_HDR_SRATE((ofdm_phy_hdr_t *) plcp, rate_signal); tmp = (length & 0xfff) << 5; @@ -5718,7 +5719,7 @@ wlc_d11hdrs_mac80211(wlc_info_t *wlc, struct ieee80211_hw *hw, /* add Broadcom tx descriptor header */ txh = (d11txh_t *) skb_push(p, D11_TXH_LEN); - bzero((char *)txh, D11_TXH_LEN); + memset((char *)txh, 0, D11_TXH_LEN); /* setup frameid */ if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { @@ -6134,9 +6135,10 @@ wlc_d11hdrs_mac80211(wlc_info_t *wlc, struct ieee80211_hw *hw, D11A_PHY_HDR_GRATE((ofdm_phy_hdr_t *) rts_plcp) : rts_plcp[0]) << 8; } else { - bzero((char *)txh->RTSPhyHeader, D11_PHY_HDR_LEN); - bzero((char *)&txh->rts_frame, sizeof(struct dot11_rts_frame)); - bzero((char *)txh->RTSPLCPFallback, + memset((char *)txh->RTSPhyHeader, 0, D11_PHY_HDR_LEN); + memset((char *)&txh->rts_frame, 0, + sizeof(struct dot11_rts_frame)); + memset((char *)txh->RTSPLCPFallback, 0, sizeof(txh->RTSPLCPFallback)); txh->RTSDurFallback = 0; } @@ -7274,7 +7276,7 @@ void wlc_rate_lookup_init(wlc_info_t *wlc, wlc_rateset_t *rateset) uint i; /* incoming rates are in 500kbps units as in 802.11 Supported Rates */ - bzero(br, WLC_MAXRATE + 1); + memset(br, 0, WLC_MAXRATE + 1); /* For each basic rate in the rates list, make an entry in the * best basic lookup. @@ -7608,7 +7610,7 @@ wlc_bcn_prb_template(wlc_info_t *wlc, uint type, ratespec_t bcn_rspec, *len = hdr_len + body_len; /* return actual size */ /* format PHY and MAC headers */ - bzero((char *)buf, hdr_len); + memset((char *)buf, 0, hdr_len); plcp = (cck_phy_hdr_t *) buf; @@ -7729,7 +7731,7 @@ void wlc_shm_ssid_upd(wlc_info_t *wlc, wlc_bsscfg_t *cfg) u8 ssidbuf[DOT11_MAX_SSID_LEN]; /* padding the ssid with zero and copy it into shm */ - bzero(ssidbuf, DOT11_MAX_SSID_LEN); + memset(ssidbuf, 0, DOT11_MAX_SSID_LEN); bcopy(ssidptr, ssidbuf, cfg->SSID_len); wlc_copyto_shm(wlc, base, ssidbuf, DOT11_MAX_SSID_LEN); @@ -7845,7 +7847,7 @@ void wlc_reprate_init(wlc_info_t *wlc) void wlc_bsscfg_reprate_init(wlc_bsscfg_t *bsscfg) { bsscfg->txrspecidx = 0; - bzero((char *)bsscfg->txrspec, sizeof(bsscfg->txrspec)); + memset((char *)bsscfg->txrspec, 0, sizeof(bsscfg->txrspec)); } /* Retrieve a consolidated set of revision information, @@ -7900,7 +7902,7 @@ static void wlc_bss_default_init(wlc_info_t *wlc) wlc_bss_info_t *bi = wlc->default_bss; /* init default and target BSS with some sane initial values */ - bzero((char *)(bi), sizeof(wlc_bss_info_t)); + memset((char *)(bi), 0, sizeof(wlc_bss_info_t)); bi->beacon_period = ISSIM_ENAB(wlc->pub->sih) ? BEACON_INTERVAL_DEF_QT : BEACON_INTERVAL_DEFAULT; bi->dtim_period = ISSIM_ENAB(wlc->pub->sih) ? DTIM_INTERVAL_DEF_QT : diff --git a/drivers/staging/brcm80211/sys/wlc_rate.c b/drivers/staging/brcm80211/sys/wlc_rate.c index e1199b2..ab7d0be 100644 --- a/drivers/staging/brcm80211/sys/wlc_rate.c +++ b/drivers/staging/brcm80211/sys/wlc_rate.c @@ -299,7 +299,7 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs, uint count; uint i; - bzero(rateset, sizeof(rateset)); + memset(rateset, 0, sizeof(rateset)); count = rs->count; for (i = 0; i < count; i++) { diff --git a/drivers/staging/brcm80211/util/bcmotp.c b/drivers/staging/brcm80211/util/bcmotp.c index 499cf03..ac25989 100644 --- a/drivers/staging/brcm80211/util/bcmotp.c +++ b/drivers/staging/brcm80211/util/bcmotp.c @@ -901,7 +901,7 @@ void *otp_init(si_t *sih) void *ret = NULL; oi = &otpinfo; - bzero(oi, sizeof(otpinfo_t)); + memset(oi, 0, sizeof(otpinfo_t)); oi->ccrev = sih->ccrev; diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c index af4658e..7709846 100644 --- a/drivers/staging/brcm80211/util/bcmsrom.c +++ b/drivers/staging/brcm80211/util/bcmsrom.c @@ -405,7 +405,7 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars, return -2; varbuf_init(&b, base, MAXSZ_NVRAM_VARS); - bzero(base, MAXSZ_NVRAM_VARS); + memset(base, 0, MAXSZ_NVRAM_VARS); eabuf[0] = '\0'; for (cisnum = 0; cisnum < ciscnt; cisnum++) { cis = *pcis++; diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index 49c1f74..64d1440 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c @@ -266,7 +266,7 @@ void pktq_init(struct pktq *pq, int num_prec, int max_len) ASSERT(num_prec > 0 && num_prec <= PKTQ_MAX_PREC); /* pq is variable size; only zero out what's requested */ - bzero(pq, + memset(pq, 0, offsetof(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec)); pq->num_prec = (u16) num_prec; diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c index 3c85aa5..996998d 100644 --- a/drivers/staging/brcm80211/util/hnddma.c +++ b/drivers/staging/brcm80211/util/hnddma.c @@ -1118,7 +1118,8 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di) *(u32 *) (p->data) = 0; if (DMASGLIST_ENAB) - bzero(&di->rxp_dmah[rxout], sizeof(hnddma_seg_map_t)); + memset(&di->rxp_dmah[rxout], 0, + sizeof(hnddma_seg_map_t)); pa = DMA_MAP(di->osh, p->data, di->rxbufsize, DMA_RX, p, &di->rxp_dmah[rxout]); @@ -1688,7 +1689,8 @@ static int dma32_txfast(dma_info_t *di, struct sk_buff *p0, bool commit) continue; if (DMASGLIST_ENAB) - bzero(&di->txp_dmah[txout], sizeof(hnddma_seg_map_t)); + memset(&di->txp_dmah[txout], 0, + sizeof(hnddma_seg_map_t)); /* get physical address of buffer start */ pa = DMA_MAP(di->osh, data, len, DMA_TX, p, @@ -1960,7 +1962,7 @@ static void dma32_txrotate(dma_info_t *di) if (DMASGLIST_ENAB) { bcopy(&di->txp_dmah[old], &di->txp_dmah[new], sizeof(hnddma_seg_map_t)); - bzero(&di->txp_dmah[old], sizeof(hnddma_seg_map_t)); + memset(&di->txp_dmah[old], 0, sizeof(hnddma_seg_map_t)); } di->txp[old] = NULL; @@ -2339,7 +2341,8 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, struct sk_buff *p0, /* get physical address of buffer start */ if (DMASGLIST_ENAB) - bzero(&di->txp_dmah[txout], sizeof(hnddma_seg_map_t)); + memset(&di->txp_dmah[txout], 0, + sizeof(hnddma_seg_map_t)); pa = DMA_MAP(di->osh, data, len, DMA_TX, p, &di->txp_dmah[txout]); @@ -2637,7 +2640,7 @@ static void dma64_txrotate(dma_info_t *di) if (DMASGLIST_ENAB) { bcopy(&di->txp_dmah[old], &di->txp_dmah[new], sizeof(hnddma_seg_map_t)); - bzero(&di->txp_dmah[old], sizeof(hnddma_seg_map_t)); + memset(&di->txp_dmah[old], 0, sizeof(hnddma_seg_map_t)); } di->txp[old] = NULL; diff --git a/drivers/staging/brcm80211/util/linux_osl.c b/drivers/staging/brcm80211/util/linux_osl.c index 260995e..6a06d61 100644 --- a/drivers/staging/brcm80211/util/linux_osl.c +++ b/drivers/staging/brcm80211/util/linux_osl.c @@ -43,7 +43,7 @@ struct osl_info *osl_attach(void *pdev, uint bustype) osh = kmalloc(sizeof(struct osl_info), GFP_ATOMIC); ASSERT(osh); - bzero(osh, sizeof(struct osl_info)); + memset(osh, 0, sizeof(struct osl_info)); osh->magic = OS_HANDLE_MAGIC; osh->pdev = pdev; diff --git a/drivers/staging/brcm80211/util/siutils.c b/drivers/staging/brcm80211/util/siutils.c index 050c2d2..1a9ff1a 100644 --- a/drivers/staging/brcm80211/util/siutils.c +++ b/drivers/staging/brcm80211/util/siutils.c @@ -380,7 +380,7 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid, struct osl_info *osh, ASSERT(GOODREGS(regs)); - bzero((unsigned char *) sii, sizeof(si_info_t)); + memset((unsigned char *) sii, 0, sizeof(si_info_t)); savewin = 0; @@ -510,7 +510,7 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid, struct osl_info *osh, ASSERT(GOODREGS(regs)); - bzero((unsigned char *) sii, sizeof(si_info_t)); + memset((unsigned char *) sii, 0, sizeof(si_info_t)); savewin = 0; -- 1.6.3.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel