On Mon, Jun 1, 2015 at 7:53 PM, Jason Gunthorpe
<[email protected]> wrote:
> On Sun, May 31, 2015 at 03:14:10PM +0300, Or Gerlitz wrote:
>
>> + struct ib_cq_init_attr cq_attr;
>>
>> /* Create new device info */
>> port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL);
>> @@ -2943,9 +2944,11 @@ static int ib_mad_port_open(struct ib_device *device,
>> if (has_smi)
>> cq_size *= 2;
>>
>> + memset(&cq_attr, 0, sizeof(cq_attr));
>> + cq_attr.cqe = cq_size;
>
> Why does this patch switch to using memset when the prior patch used
> = {} ?
>
Why does it matter? Both are valid approaches, aren't they?
>> @@ -1075,12 +1075,11 @@ EXPORT_SYMBOL(ib_destroy_qp);
>> struct ib_cq *ib_create_cq(struct ib_device *device,
>> ib_comp_handler comp_handler,
>> void (*event_handler)(struct ib_event *, void *),
>> - void *cq_context, int cqe, int comp_vector)
>> + void *cq_context, struct ib_cq_init_attr *cq_attr)
>> {
>> struct ib_cq *cq;
>> - struct ib_cq_init_attr attr = {.cqe = cqe, .comp_vector = comp_vector};
>>
>> - cq = device->create_cq(device, &attr, NULL, NULL);
>> + cq = device->create_cq(device, cq_attr, NULL, NULL);
>
> How does this compile without warnings?
>
Do you mean that there's a missing const here? It doesn't (and shouldn't)
cause warnings.
However, ib_create_cq could be changed that it'll get const cq_attr as well.
> The prior patch did:
>
> - struct ib_cq * (*create_cq)(struct ib_device *device, int
> cqe,
> - int comp_vector,
> + struct ib_cq * (*create_cq)(struct ib_device *device,
> + const struct ib_cq_init_attr
> *attr,
> struct ib_ucontext *context,
> struct ib_udata *udata);
>
> Otherwise looks OK.
>
> Jason
Thanks for the review.
Matan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html