Commit 72bca208 authored by Himanshu Jha's avatar Himanshu Jha Committed by David S. Miller

liquidio: Use zeroing memory allocator than allocator/memset

Use vzalloc for allocating zeroed memory and remove unnecessary
memset function.

Done using Coccinelle.
Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
0-day tested with no failures.
Suggested-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: default avatarHimanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa006d1a
...@@ -702,12 +702,10 @@ static struct octeon_device *octeon_allocate_device_mem(u32 pci_id, ...@@ -702,12 +702,10 @@ static struct octeon_device *octeon_allocate_device_mem(u32 pci_id,
size = octdevsize + priv_size + configsize + size = octdevsize + priv_size + configsize +
(sizeof(struct octeon_dispatch) * DISPATCH_LIST_SIZE); (sizeof(struct octeon_dispatch) * DISPATCH_LIST_SIZE);
buf = vmalloc(size); buf = vzalloc(size);
if (!buf) if (!buf)
return NULL; return NULL;
memset(buf, 0, size);
oct = (struct octeon_device *)buf; oct = (struct octeon_device *)buf;
oct->priv = (void *)(buf + octdevsize); oct->priv = (void *)(buf + octdevsize);
oct->chip = (void *)(buf + octdevsize + priv_size); oct->chip = (void *)(buf + octdevsize + priv_size);
...@@ -840,10 +838,9 @@ octeon_allocate_ioq_vector(struct octeon_device *oct) ...@@ -840,10 +838,9 @@ octeon_allocate_ioq_vector(struct octeon_device *oct)
size = sizeof(struct octeon_ioq_vector) * num_ioqs; size = sizeof(struct octeon_ioq_vector) * num_ioqs;
oct->ioq_vector = vmalloc(size); oct->ioq_vector = vzalloc(size);
if (!oct->ioq_vector) if (!oct->ioq_vector)
return 1; return 1;
memset(oct->ioq_vector, 0, size);
for (i = 0; i < num_ioqs; i++) { for (i = 0; i < num_ioqs; i++) {
ioq_vector = &oct->ioq_vector[i]; ioq_vector = &oct->ioq_vector[i];
ioq_vector->oct_dev = oct; ioq_vector->oct_dev = oct;
......
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