diff mbox

[rdma-core,2/3] libqedr: Remove redundant memset

Message ID 1487224571-18627-3-git-send-email-Ram.Amrani@cavium.com (mailing list archive)
State Accepted
Headers show

Commit Message

Amrani, Ram Feb. 16, 2017, 5:56 a.m. UTC
The memset was invoked with a size of zero. But anyway, zeroing of the
CQ/RQ/SQ is not required since mmap is used with MAP_ANONYNMOUS that
zeros the queue anyway.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
---
 providers/qedr/qelr_chain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/providers/qedr/qelr_chain.c b/providers/qedr/qelr_chain.c
index d9ccc0b..26d0d0a 100644
--- a/providers/qedr/qelr_chain.c
+++ b/providers/qedr/qelr_chain.c
@@ -87,7 +87,6 @@  int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size,
 
 	/* init chain */
 	memset(chain, 0, sizeof(*chain));
-	memset(chain->first_addr, 0, chain->size);
 	chain->first_addr = addr;
 	chain->size = a_chain_size;
 	chain->p_cons_elem = chain->first_addr;
@@ -97,6 +96,8 @@  int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size,
 	chain->last_addr = (void *)
 			((uint8_t *)addr + (elem_size * (chain->n_elems -1)));
 
+	/* Note: since we are using MAP_ANONYMOUS the chain is zeroed for us */
+
 	return 0;
 }