[rds-devel] [External] : Re: [PATCH rdma-next v6] RDMA: Change capability fields in ib_device_attr from int to u32
Erni Sri Satya Vennela
ernis at linux.microsoft.com
Sat Jun 6 06:48:07 UTC 2026
On Mon, Jun 01, 2026 at 08:51:40AM -0700, Bart Van Assche wrote:
> - ch->rq_size = min(MAX_SRPT_RQ_SIZE, sdev->device->attrs.max_qp_wr);
> > + ch->rq_size = min_t(u32, MAX_SRPT_RQ_SIZE, sdev->device->attrs.max_qp_wr);
> > spin_lock_init(&ch->spinlock);
> > ch->state = CH_CONNECTING;
> > INIT_LIST_HEAD(&ch->cmd_wait_list);
> > @@ -3225,7 +3225,7 @@ static int srpt_add_one(struct ib_device *device)
> > sdev->lkey = sdev->pd->local_dma_lkey;
> > - sdev->srq_size = min(srpt_srq_size, sdev->device->attrs.max_srq_wr);
> > + sdev->srq_size = min_t(u32, srpt_srq_size, sdev->device->attrs.max_srq_wr);
> > srpt_use_srq(sdev, sdev->port[0].port_attrib.use_srq);
>
> min_t() shouldn't be used if there is an alternative available. For the
> SRP drivers, please make sure that both arguments of min() are unsigned
> instead of using min_t().
Thankyou for your suggestion, Bart.
I'll update this in the next version.
- Vennela
> Thanks,
>
> Bart.
More information about the rds-devel
mailing list