RE: [PATCH rdma-next 4/6] RDMA/mana_ib: introduce a helper to remove cq callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > > +void mana_ib_remove_cq_cb(struct mana_ib_dev *mdev, struct
> > > mana_ib_cq
> > > +*cq) {
> > > +	struct gdma_context *gc = mdev_to_gc(mdev);
> > > +
> > > +	if (cq->queue.id >= gc->max_num_cqs)
> > > +		return;
> > > +
> > > +	kfree(gc->cq_table[cq->queue.id]);
> > > +	gc->cq_table[cq->queue.id] = NULL;
> >
> > Why the check for (cq->queue.id != INVALID_QUEUE_ID) is removed?
> 
> As max_num_cqs is always less than INVALID_QUEUE_ID, it is included in the "if".
> I can add " || cq->queue.id == INVALID_QUEUE_ID " to the condition if you want.

Okay, can you add a comment before if (cq->queue.id >= gc->max_num_cqs) saying it also works with INVALID_QUEUE_ID?




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux