aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-10-03 18:45:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-06 18:14:56 -0400
commit0345f37be64905846a1ef38378061d4c2730242e (patch)
treedd347d7c5e4c106ce07dc10bededf11a824ba60a /drivers
parent8ef9dad3f7c0bdae84cd57f2bc6d4f53421406a8 (diff)
ath9k: kill ath9k's memzero() and use memset() instead
Part of the cleanup on ath9k -- this was also causing some annoying compile time warnings. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath9k/beacon.c8
-rw-r--r--drivers/net/wireless/ath9k/core.c14
-rw-r--r--drivers/net/wireless/ath9k/core.h5
-rw-r--r--drivers/net/wireless/ath9k/recv.c4
-rw-r--r--drivers/net/wireless/ath9k/xmit.c10
5 files changed, 19 insertions, 22 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c
index eedb465d25d3..9e15c30bbc06 100644
--- a/drivers/net/wireless/ath9k/beacon.c
+++ b/drivers/net/wireless/ath9k/beacon.c
@@ -129,7 +129,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
129 ds /* first descriptor */ 129 ds /* first descriptor */
130 ); 130 );
131 131
132 memzero(series, sizeof(struct ath9k_11n_rate_series) * 4); 132 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
133 series[0].Tries = 1; 133 series[0].Tries = 1;
134 series[0].Rate = rate; 134 series[0].Rate = rate;
135 series[0].ChSel = sc->sc_tx_chainmask; 135 series[0].ChSel = sc->sc_tx_chainmask;
@@ -282,7 +282,7 @@ int ath_beaconq_setup(struct ath_hal *ah)
282{ 282{
283 struct ath9k_tx_queue_info qi; 283 struct ath9k_tx_queue_info qi;
284 284
285 memzero(&qi, sizeof(qi)); 285 memset(&qi, 0, sizeof(qi));
286 qi.tqi_aifs = 1; 286 qi.tqi_aifs = 1;
287 qi.tqi_cwmin = 0; 287 qi.tqi_cwmin = 0;
288 qi.tqi_cwmax = 0; 288 qi.tqi_cwmax = 0;
@@ -662,7 +662,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
662 else 662 else
663 av_opmode = sc->sc_ah->ah_opmode; 663 av_opmode = sc->sc_ah->ah_opmode;
664 664
665 memzero(&conf, sizeof(struct ath_beacon_config)); 665 memset(&conf, 0, sizeof(struct ath_beacon_config));
666 666
667 conf.beacon_interval = sc->hw->conf.beacon_int ? 667 conf.beacon_interval = sc->hw->conf.beacon_int ?
668 sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL; 668 sc->hw->conf.beacon_int : ATH_DEFAULT_BINTVAL;
@@ -738,7 +738,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
738 } 738 }
739 } while (nexttbtt < tsftu); 739 } while (nexttbtt < tsftu);
740#undef FUDGE 740#undef FUDGE
741 memzero(&bs, sizeof(bs)); 741 memset(&bs, 0, sizeof(bs));
742 bs.bs_intval = intval; 742 bs.bs_intval = intval;
743 bs.bs_nexttbtt = nexttbtt; 743 bs.bs_nexttbtt = nexttbtt;
744 bs.bs_dtimperiod = dtimperiod*intval; 744 bs.bs_dtimperiod = dtimperiod*intval;
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index d7f5257d2ec1..5af7dfbd423d 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -65,7 +65,7 @@ static void ath_setcurmode(struct ath_softc *sc, enum wireless_mode mode)
65 for (i = 0; i < rt->rateCount; i++) 65 for (i = 0; i < rt->rateCount; i++)
66 sc->sc_rixmap[rt->info[i].rateCode] = (u8) i; 66 sc->sc_rixmap[rt->info[i].rateCode] = (u8) i;
67 67
68 memzero(sc->sc_hwmap, sizeof(sc->sc_hwmap)); 68 memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap));
69 for (i = 0; i < 256; i++) { 69 for (i = 0; i < 256; i++) {
70 u8 ix = rt->rateCodeToIndex[i]; 70 u8 ix = rt->rateCodeToIndex[i];
71 71
@@ -417,7 +417,7 @@ static void ath_chainmask_sel_init(struct ath_softc *sc, struct ath_node *an)
417{ 417{
418 struct ath_chainmask_sel *cm = &an->an_chainmask_sel; 418 struct ath_chainmask_sel *cm = &an->an_chainmask_sel;
419 419
420 memzero(cm, sizeof(struct ath_chainmask_sel)); 420 memset(cm, 0, sizeof(struct ath_chainmask_sel));
421 421
422 cm->cur_tx_mask = sc->sc_tx_chainmask; 422 cm->cur_tx_mask = sc->sc_tx_chainmask;
423 cm->cur_rx_mask = sc->sc_rx_chainmask; 423 cm->cur_rx_mask = sc->sc_rx_chainmask;
@@ -526,7 +526,7 @@ int ath_vap_attach(struct ath_softc *sc,
526 if (avp == NULL) 526 if (avp == NULL)
527 return -ENOMEM; 527 return -ENOMEM;
528 528
529 memzero(avp, sizeof(struct ath_vap)); 529 memset(avp, 0, sizeof(struct ath_vap));
530 avp->av_if_data = if_data; 530 avp->av_if_data = if_data;
531 /* Set the VAP opmode */ 531 /* Set the VAP opmode */
532 avp->av_opmode = opmode; 532 avp->av_opmode = opmode;
@@ -1219,7 +1219,7 @@ struct ath_node *ath_node_attach(struct ath_softc *sc, u8 *addr, int if_id)
1219 an = kmalloc(sizeof(struct ath_node), GFP_ATOMIC); 1219 an = kmalloc(sizeof(struct ath_node), GFP_ATOMIC);
1220 if (an == NULL) 1220 if (an == NULL)
1221 return NULL; 1221 return NULL;
1222 memzero(an, sizeof(*an)); 1222 memset(an, 0, sizeof(*an));
1223 1223
1224 an->an_sc = sc; 1224 an->an_sc = sc;
1225 memcpy(an->an_addr, addr, ETH_ALEN); 1225 memcpy(an->an_addr, addr, ETH_ALEN);
@@ -1606,7 +1606,7 @@ int ath_descdma_setup(struct ath_softc *sc,
1606 error = -ENOMEM; 1606 error = -ENOMEM;
1607 goto fail2; 1607 goto fail2;
1608 } 1608 }
1609 memzero(bf, bsize); 1609 memset(bf, 0, bsize);
1610 dd->dd_bufptr = bf; 1610 dd->dd_bufptr = bf;
1611 1611
1612 INIT_LIST_HEAD(head); 1612 INIT_LIST_HEAD(head);
@@ -1638,7 +1638,7 @@ fail2:
1638 pci_free_consistent(sc->pdev, 1638 pci_free_consistent(sc->pdev,
1639 dd->dd_desc_len, dd->dd_desc, dd->dd_desc_paddr); 1639 dd->dd_desc_len, dd->dd_desc, dd->dd_desc_paddr);
1640fail: 1640fail:
1641 memzero(dd, sizeof(*dd)); 1641 memset(dd, 0, sizeof(*dd));
1642 return error; 1642 return error;
1643#undef ATH_DESC_4KB_BOUND_CHECK 1643#undef ATH_DESC_4KB_BOUND_CHECK
1644#undef ATH_DESC_4KB_BOUND_NUM_SKIPPED 1644#undef ATH_DESC_4KB_BOUND_NUM_SKIPPED
@@ -1663,7 +1663,7 @@ void ath_descdma_cleanup(struct ath_softc *sc,
1663 1663
1664 INIT_LIST_HEAD(head); 1664 INIT_LIST_HEAD(head);
1665 kfree(dd->dd_bufptr); 1665 kfree(dd->dd_bufptr);
1666 memzero(dd, sizeof(*dd)); 1666 memset(dd, 0, sizeof(*dd));
1667} 1667}
1668 1668
1669/*************/ 1669/*************/
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index 872f0c5a0b0e..80814c9910c9 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -84,9 +84,6 @@ struct ath_node;
84#define TSF_TO_TU(_h,_l) \ 84#define TSF_TO_TU(_h,_l) \
85 ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) 85 ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
86 86
87/* XXX: remove */
88#define memzero(_buf, _len) memset(_buf, 0, _len)
89
90#define ATH9K_BH_STATUS_INTACT 0 87#define ATH9K_BH_STATUS_INTACT 0
91#define ATH9K_BH_STATUS_CHANGE 1 88#define ATH9K_BH_STATUS_CHANGE 1
92 89
@@ -184,7 +181,7 @@ void ath_update_chainmask(struct ath_softc *sc, int is_ht);
184 (_bf)->bf_lastbf = NULL; \ 181 (_bf)->bf_lastbf = NULL; \
185 (_bf)->bf_lastfrm = NULL; \ 182 (_bf)->bf_lastfrm = NULL; \
186 (_bf)->bf_next = NULL; \ 183 (_bf)->bf_next = NULL; \
187 memzero(&((_bf)->bf_state), \ 184 memset(&((_bf)->bf_state), 0, \
188 sizeof(struct ath_buf_state)); \ 185 sizeof(struct ath_buf_state)); \
189 } while (0) 186 } while (0)
190 187
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 498256309ab7..f4be5d11c9d5 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -892,7 +892,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
892 892
893 hdr = (struct ieee80211_hdr *)skb->data; 893 hdr = (struct ieee80211_hdr *)skb->data;
894 fc = hdr->frame_control; 894 fc = hdr->frame_control;
895 memzero(&rx_status, sizeof(struct ath_recv_status)); 895 memset(&rx_status, 0, sizeof(struct ath_recv_status));
896 896
897 if (ds->ds_rxstat.rs_more) { 897 if (ds->ds_rxstat.rs_more) {
898 /* 898 /*
@@ -1166,7 +1166,7 @@ int ath_rx_aggr_start(struct ath_softc *sc,
1166 } else { 1166 } else {
1167 /* Ensure the memory is zeroed out (all internal 1167 /* Ensure the memory is zeroed out (all internal
1168 * pointers are null) */ 1168 * pointers are null) */
1169 memzero(rxtid->rxbuf, ATH_TID_MAX_BUFS * 1169 memset(rxtid->rxbuf, 0, ATH_TID_MAX_BUFS *
1170 sizeof(struct ath_rxbuf)); 1170 sizeof(struct ath_rxbuf));
1171 DPRINTF(sc, ATH_DBG_AGGR, 1171 DPRINTF(sc, ATH_DBG_AGGR,
1172 "%s: Allocated @%p\n", __func__, rxtid->rxbuf); 1172 "%s: Allocated @%p\n", __func__, rxtid->rxbuf);
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index 25929059c7dc..bdcb9e1799ca 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -729,7 +729,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
729 /* 729 /*
730 * Setup HAL rate series 730 * Setup HAL rate series
731 */ 731 */
732 memzero(series, sizeof(struct ath9k_11n_rate_series) * 4); 732 memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
733 733
734 for (i = 0; i < 4; i++) { 734 for (i = 0; i < 4; i++) {
735 if (!bf->bf_rcs[i].tries) 735 if (!bf->bf_rcs[i].tries)
@@ -817,7 +817,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
817 * Disable multi-rate retry when using RTS/CTS by clearing 817 * Disable multi-rate retry when using RTS/CTS by clearing
818 * series 1, 2 and 3. 818 * series 1, 2 and 3.
819 */ 819 */
820 memzero(&series[1], sizeof(struct ath9k_11n_rate_series) * 3); 820 memset(&series[1], 0, sizeof(struct ath9k_11n_rate_series) * 3);
821 } 821 }
822 822
823 /* 823 /*
@@ -930,7 +930,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,
930 ATH_DS_BA_BITMAP(ds), 930 ATH_DS_BA_BITMAP(ds),
931 WME_BA_BMP_SIZE >> 3); 931 WME_BA_BMP_SIZE >> 3);
932 } else { 932 } else {
933 memzero(ba, WME_BA_BMP_SIZE >> 3); 933 memset(ba, 0, WME_BA_BMP_SIZE >> 3);
934 934
935 /* 935 /*
936 * AR5416 can become deaf/mute when BA 936 * AR5416 can become deaf/mute when BA
@@ -943,7 +943,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,
943 needreset = 1; 943 needreset = 1;
944 } 944 }
945 } else { 945 } else {
946 memzero(ba, WME_BA_BMP_SIZE >> 3); 946 memset(ba, 0, WME_BA_BMP_SIZE >> 3);
947 } 947 }
948 } 948 }
949 949
@@ -2098,7 +2098,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
2098 struct ath9k_tx_queue_info qi; 2098 struct ath9k_tx_queue_info qi;
2099 int qnum; 2099 int qnum;
2100 2100
2101 memzero(&qi, sizeof(qi)); 2101 memset(&qi, 0, sizeof(qi));
2102 qi.tqi_subtype = subtype; 2102 qi.tqi_subtype = subtype;
2103 qi.tqi_aifs = ATH9K_TXQ_USEDEFAULT; 2103 qi.tqi_aifs = ATH9K_TXQ_USEDEFAULT;
2104 qi.tqi_cwmin = ATH9K_TXQ_USEDEFAULT; 2104 qi.tqi_cwmin = ATH9K_TXQ_USEDEFAULT;