aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgb
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-07-19 22:04:07 +0800
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-08-24 08:52:35 -0700
commita9910c0886470b659a6c3629d6467d5639c327e9 (patch)
treefb77f14ff35c3f49cdc7eaae4dc197fbe8139d63 /drivers/net/ethernet/intel/ixgb
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf (diff)
downloadlinux-dev-a9910c0886470b659a6c3629d6467d5639c327e9.tar.xz
linux-dev-a9910c0886470b659a6c3629d6467d5639c327e9.zip
ixgb: use dma_zalloc_coherent instead of allocator/memset
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgb')
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 43664adf7a3c..d3e72d0f66ef 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -771,14 +771,13 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
rxdr->size = ALIGN(rxdr->size, 4096);
- rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
- GFP_KERNEL);
+ rxdr->desc = dma_zalloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
+ GFP_KERNEL);
if (!rxdr->desc) {
vfree(rxdr->buffer_info);
return -ENOMEM;
}
- memset(rxdr->desc, 0, rxdr->size);
rxdr->next_to_clean = 0;
rxdr->next_to_use = 0;