aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-08-08 14:24:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 15:57:29 -0700
commit8c6a5dca88401d119e2e6b8e81c2ea3b9b18b4ff (patch)
tree8b936b71c4c5a3098f555264456c91eeb1d7283a /drivers/net/ethernet
parentmedia: use pci_zalloc_consistent (diff)
downloadlinux-dev-8c6a5dca88401d119e2e6b8e81c2ea3b9b18b4ff.tar.xz
linux-dev-8c6a5dca88401d119e2e6b8e81c2ea3b9b18b4ff.zip
amd: use pci_zalloc_consistent
Remove the now unnecessary memset too. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Don Fry <pcnet32@frontier.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/amd/pcnet32.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index e7cc9174e364..8099fdcce0c9 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -484,15 +484,14 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
pcnet32_purge_tx_ring(dev);
- new_tx_ring = pci_alloc_consistent(lp->pci_dev,
- sizeof(struct pcnet32_tx_head) *
- (1 << size),
- &new_ring_dma_addr);
+ new_tx_ring = pci_zalloc_consistent(lp->pci_dev,
+ sizeof(struct pcnet32_tx_head) *
+ (1 << size),
+ &new_ring_dma_addr);
if (new_tx_ring == NULL) {
netif_err(lp, drv, dev, "Consistent memory allocation failed\n");
return;
}
- memset(new_tx_ring, 0, sizeof(struct pcnet32_tx_head) * (1 << size));
new_dma_addr_list = kcalloc(1 << size, sizeof(dma_addr_t),
GFP_ATOMIC);
@@ -551,15 +550,14 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
int new, overlap;
unsigned int entries = 1 << size;
- new_rx_ring = pci_alloc_consistent(lp->pci_dev,
- sizeof(struct pcnet32_rx_head) *
- entries,
- &new_ring_dma_addr);
+ new_rx_ring = pci_zalloc_consistent(lp->pci_dev,
+ sizeof(struct pcnet32_rx_head) *
+ entries,
+ &new_ring_dma_addr);
if (new_rx_ring == NULL) {
netif_err(lp, drv, dev, "Consistent memory allocation failed\n");
return;
}
- memset(new_rx_ring, 0, sizeof(struct pcnet32_rx_head) * entries);
new_dma_addr_list = kcalloc(entries, sizeof(dma_addr_t), GFP_ATOMIC);
if (!new_dma_addr_list)