[openib-general] ib_req_ncomp_notif in core_ layer

Michael S. Tsirkin mst at mellanox.co.il
Wed Aug 4 01:41:38 PDT 2004


Hello!
I am looking at the ib core gen2 code now, and I am puzzled by
the fact that some functions just seem to do a check and then copy
another one. Taking the following example

int ib_req_ncomp_notif(struct ib_cq *cq, int wc_cnt)
{
  return cq->device->req_ncomp_notif ?
    cq->device->req_ncomp_notif(cq, wc_cnt) :
    -ENOSYS;
}


Why cant all users just do device->req_ncomp_notif(cq, wc_cnt) directly?

Its true that req_ncomp_notif could be NULL, but this could
be fixed, instead, by modifying it to a reasonable default when
the device is initialised.

Same goes for ib_resize_cq and some others.


Thanks,
MST



More information about the general mailing list