[ofa-general] Re: [PATCH 11/11] mlx4: XRC receive-only QPs

Roland Dreier rdreier at cisco.com
Mon Jun 23 09:39:45 PDT 2008


 > @@ -178,6 +178,7 @@ struct ib_cq *mlx4_ib_create_cq(struct i
 >  	if (!cq)
 >  		return ERR_PTR(-ENOMEM);
 >  
 > +	memset(cq, 0, sizeof *cq);
 >  	entries      = roundup_pow_of_two(entries + 1);
 >  	cq->ibcq.cqe = entries - 1;
 >  	mutex_init(&cq->resize_mutex);

Why is this change necessary?

If it is necessary it would be more sensible to use kzalloc() to
allocate the structure (and get rid of the initialization to NULL of
some members too) -- that would actually shrink the code rather than
bloating it.

 - R.



More information about the general mailing list