diff options
author | Himanshu Jha <himanshujha199640@gmail.com> | 2017-12-30 21:07:04 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-02 21:55:43 -0500 |
commit | 5f58dff96755b9bfa13be834a2cca9e4778df20d (patch) | |
tree | 20d19abc60f2452df5561d62805d2a8b6a9b093b /drivers/net/ethernet/qlogic/qed/qed_l2.c | |
parent | 3288ed69c06bf720afc99ce3850e8ca746376ad1 (diff) |
qed: Use zeroing memory allocator than allocator/memset
Use dma_zalloc_coherent and 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: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Acked-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_l2.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_l2.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index 59ecc1e87faf..893ef08a4b39 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c @@ -223,10 +223,9 @@ _qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, struct qed_queue_cid *p_cid; int rc; - p_cid = vmalloc(sizeof(*p_cid)); + p_cid = vzalloc(sizeof(*p_cid)); if (!p_cid) return NULL; - memset(p_cid, 0, sizeof(*p_cid)); p_cid->opaque_fid = opaque_fid; p_cid->cid = cid; |