diff options
author | Joe Perches <joe@perches.com> | 2014-08-08 17:24:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:29 -0400 |
commit | e6443b24c74110309790a2bb3f5566c9fb5eac66 (patch) | |
tree | a4c80eeaf729e394d4b5382cc621798b0c5c809d /drivers/net | |
parent | f0b6539cfaa6c13c9ebaa47f0136fee7a4c2d981 (diff) |
mwl8k: use pci_zalloc_consistent
Remove the now unnecessary memset too.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 9a3d4d6724f7..fc6cb215e761 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -1159,12 +1159,11 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index) | |||
1159 | 1159 | ||
1160 | size = MWL8K_RX_DESCS * priv->rxd_ops->rxd_size; | 1160 | size = MWL8K_RX_DESCS * priv->rxd_ops->rxd_size; |
1161 | 1161 | ||
1162 | rxq->rxd = pci_alloc_consistent(priv->pdev, size, &rxq->rxd_dma); | 1162 | rxq->rxd = pci_zalloc_consistent(priv->pdev, size, &rxq->rxd_dma); |
1163 | if (rxq->rxd == NULL) { | 1163 | if (rxq->rxd == NULL) { |
1164 | wiphy_err(hw->wiphy, "failed to alloc RX descriptors\n"); | 1164 | wiphy_err(hw->wiphy, "failed to alloc RX descriptors\n"); |
1165 | return -ENOMEM; | 1165 | return -ENOMEM; |
1166 | } | 1166 | } |
1167 | memset(rxq->rxd, 0, size); | ||
1168 | 1167 | ||
1169 | rxq->buf = kcalloc(MWL8K_RX_DESCS, sizeof(*rxq->buf), GFP_KERNEL); | 1168 | rxq->buf = kcalloc(MWL8K_RX_DESCS, sizeof(*rxq->buf), GFP_KERNEL); |
1170 | if (rxq->buf == NULL) { | 1169 | if (rxq->buf == NULL) { |
@@ -1451,12 +1450,11 @@ static int mwl8k_txq_init(struct ieee80211_hw *hw, int index) | |||
1451 | 1450 | ||
1452 | size = MWL8K_TX_DESCS * sizeof(struct mwl8k_tx_desc); | 1451 | size = MWL8K_TX_DESCS * sizeof(struct mwl8k_tx_desc); |
1453 | 1452 | ||
1454 | txq->txd = pci_alloc_consistent(priv->pdev, size, &txq->txd_dma); | 1453 | txq->txd = pci_zalloc_consistent(priv->pdev, size, &txq->txd_dma); |
1455 | if (txq->txd == NULL) { | 1454 | if (txq->txd == NULL) { |
1456 | wiphy_err(hw->wiphy, "failed to alloc TX descriptors\n"); | 1455 | wiphy_err(hw->wiphy, "failed to alloc TX descriptors\n"); |
1457 | return -ENOMEM; | 1456 | return -ENOMEM; |
1458 | } | 1457 | } |
1459 | memset(txq->txd, 0, size); | ||
1460 | 1458 | ||
1461 | txq->skb = kcalloc(MWL8K_TX_DESCS, sizeof(*txq->skb), GFP_KERNEL); | 1459 | txq->skb = kcalloc(MWL8K_TX_DESCS, sizeof(*txq->skb), GFP_KERNEL); |
1462 | if (txq->skb == NULL) { | 1460 | if (txq->skb == NULL) { |