Re: [PATCH rdma-next v6] RDMA: Change capability fields in ib_device_attr from int to u32

Erni Sri Satya Vennela <[email protected]>
Newsgroups gmane.linux.network,gmane.linux.drivers.rdma,gmane.linux.kernel,gmane.linux.scsi.target.devel,gmane.linux.kernel.cifs,gmane.network.samba.internals,gmane.linux.nfs
Message-ID <aiPCpyVN7IYbQgyA@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.