Commit 8ac41b9d authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

rtlwifi: use pci_zalloc_consistent

Remove the now unnecessary memset too.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 504e3b4f
...@@ -1092,16 +1092,14 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw, ...@@ -1092,16 +1092,14 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
u32 nextdescaddress; u32 nextdescaddress;
int i; int i;
ring = pci_alloc_consistent(rtlpci->pdev, ring = pci_zalloc_consistent(rtlpci->pdev, sizeof(*ring) * entries,
sizeof(*ring) * entries, &dma); &dma);
if (!ring || (unsigned long)ring & 0xFF) { if (!ring || (unsigned long)ring & 0xFF) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
"Cannot allocate TX ring (prio = %d)\n", prio); "Cannot allocate TX ring (prio = %d)\n", prio);
return -ENOMEM; return -ENOMEM;
} }
memset(ring, 0, sizeof(*ring) * entries);
rtlpci->tx_ring[prio].desc = ring; rtlpci->tx_ring[prio].desc = ring;
rtlpci->tx_ring[prio].dma = dma; rtlpci->tx_ring[prio].dma = dma;
rtlpci->tx_ring[prio].idx = 0; rtlpci->tx_ring[prio].idx = 0;
...@@ -1139,9 +1137,8 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) ...@@ -1139,9 +1137,8 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
for (rx_queue_idx = 0; rx_queue_idx < RTL_PCI_MAX_RX_QUEUE; for (rx_queue_idx = 0; rx_queue_idx < RTL_PCI_MAX_RX_QUEUE;
rx_queue_idx++) { rx_queue_idx++) {
rtlpci->rx_ring[rx_queue_idx].desc = rtlpci->rx_ring[rx_queue_idx].desc =
pci_alloc_consistent(rtlpci->pdev, pci_zalloc_consistent(rtlpci->pdev,
sizeof(*rtlpci->rx_ring[rx_queue_idx]. sizeof(*rtlpci->rx_ring[rx_queue_idx].desc) * rtlpci->rxringcount,
desc) * rtlpci->rxringcount,
&rtlpci->rx_ring[rx_queue_idx].dma); &rtlpci->rx_ring[rx_queue_idx].dma);
if (!rtlpci->rx_ring[rx_queue_idx].desc || if (!rtlpci->rx_ring[rx_queue_idx].desc ||
...@@ -1151,10 +1148,6 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) ...@@ -1151,10 +1148,6 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
return -ENOMEM; return -ENOMEM;
} }
memset(rtlpci->rx_ring[rx_queue_idx].desc, 0,
sizeof(*rtlpci->rx_ring[rx_queue_idx].desc) *
rtlpci->rxringcount);
rtlpci->rx_ring[rx_queue_idx].idx = 0; rtlpci->rx_ring[rx_queue_idx].idx = 0;
/* If amsdu_8k is disabled, set buffersize to 4096. This /* If amsdu_8k is disabled, set buffersize to 4096. This
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment