Re: [PATCH for-next 01/10] IB/core: Change provider's API of create_cq to be extendible

Jason Gunthorpe
2015-05-20T19:01:33Z

On Wed, May 20, 2015 at 07:41:17PM +0300, Matan Barak wrote:
> On Tue, May 19, 2015 at 9:45 PM, Jason Gunthorpe
> <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> > On Sun, May 17, 2015 at 04:36:17PM +0300, Or Gerlitz wrote:
> >> From: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >>
> >> Add a new ib_cq_init_attr structure which contains the
> >> previous cqe (minimum number of CQ entries) and comp_vector
> >> (completion vector) in addition to a new flags field.
> >> All vendors' create_cq callbacks are changed in order
> >> to work with the new API.
> >>
> >> This commit does not change any functionality.
> >
> > This seems reasonable to me.
> >
> >> @@ -1341,6 +1341,7 @@ ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file,
> >> struct ib_uverbs_event_file *ev_file = NULL;
> >> struct ib_cq *cq;
> >> int ret;
> >> + struct ib_cq_init_attr attr = {.cqe = 0};
> >
> > This doesn't seem necessary, it is unconditionally set below:
> >
>
> Almost :) It also zeros (default value) all other fields. I could
> replace it with a memset if it's clearer.

All fields are set unconditionally, so there is no need to init.

= {};

Is idomatic to zero a structure.

Jason