Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6cd4b58 authored by Thomas Meyer's avatar Thomas Meyer Committed by David S. Miller
Browse files

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: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de40fc5d
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -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->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
	nic->cbs_avail = 0;
	nic->cbs_avail = 0;


	nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
	nic->cbs = pci_pool_zalloc(nic->cbs_pool, GFP_KERNEL,
				   &nic->cbs_dma_addr);
				   &nic->cbs_dma_addr);
	if (!nic->cbs)
	if (!nic->cbs)
		return -ENOMEM;
		return -ENOMEM;
	memset(nic->cbs, 0, count * sizeof(struct cb));


	for (cb = nic->cbs, i = 0; i < count; cb++, i++) {
	for (cb = nic->cbs, i = 0; i < count; cb++, i++) {
		cb->next = (i + 1 < count) ? cb + 1 : nic->cbs;
		cb->next = (i + 1 < count) ? cb + 1 : nic->cbs;