summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e100.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2017-09-21 08:15:26 +0200
committerDavid S. Miller <davem@davemloft.net>2017-09-22 00:26:59 +0200
commitb6cd4b5895848968e8fee93fc5e3dc8babc40b9e (patch)
treeafbd6c083719813f3213f783cdf68b3a551c6dd0 /drivers/net/ethernet/intel/e100.c
parentnet: dsa: add port fdb dump (diff)
downloadlinux-b6cd4b5895848968e8fee93fc5e3dc8babc40b9e.tar.xz
linux-b6cd4b5895848968e8fee93fc5e3dc8babc40b9e.zip
e100: Cocci spatch "pool_zalloc-simple"
Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0. Found by coccinelle spatch "api/alloc/pool_zalloc-simple.cocci" Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e100.c')
-rw-r--r--drivers/net/ethernet/intel/e100.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 4d10270ddf8f..184f11242f56 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -1910,11 +1910,10 @@ static int e100_alloc_cbs(struct nic *nic)
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
nic->cbs_avail = 0;
- nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
- &nic->cbs_dma_addr);
+ nic->cbs = pci_pool_zalloc(nic->cbs_pool, GFP_KERNEL,
+ &nic->cbs_dma_addr);
if (!nic->cbs)
return -ENOMEM;
- memset(nic->cbs, 0, count * sizeof(struct cb));
for (cb = nic->cbs, i = 0; i < count; cb++, i++) {
cb->next = (i + 1 < count) ? cb + 1 : nic->cbs;