Re: [PATCH rdma-next v2] RDMA: Explicitly pass in the dma_device to ib_register_device

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

 



On Tue, Oct 06, 2020 at 08:35:54AM +0100, Christoph Hellwig wrote:
> > +	WARN_ON(!IS_ENABLED(CONFIG_DMA_VIRT_OPS) && !dma_device);
> > +	if (!dma_device) {
> >  		/*
> > -		 * The caller did not provide custom DMA operations. Use the
> > -		 * DMA mapping operations of the parent device.
> > +		 * If the caller does not provide a DMA capable device then the
> > +		 * IB device will be used. In this case the caller should fully
> > +		 * setup the ibdev for DMA. This usually means using
> > +		 * dma_virt_ops.
> >  		 */
> > +		device->dev.dma_ops = &dma_virt_ops;
> > +		dma_device = &device->dev;
>
> The lack of the if probably means this will fail to link now when
> CONFIG_DMA_VIRT_OPS is not set.  This also seems to not remove the
> dma_virt_ops assignment in the callers.

I expect to see this during driver development/testing. It is not worth
to make if() case id device won't be operable.

Thanks



[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