lkml.org 
[lkml]   [2024]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH rdma-next 4/6] RDMA/mana_ib: introduce a helper to remove cq callbacks
Date
> > > +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?
\
 
 \ /
  Last update: 2024-04-25 22:30    [W:0.069 / U:1.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site