RE: [PATCH 1/3] staging: comedi: work without HAS_DMA

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

 



On Monday, May 13, 2013 1:06 AM, Dan Carpenter wrote:
> On Fri, May 10, 2013 at 11:37:38AM -0500, H Hartley Sweeten wrote:
>> On Friday, May 10, 2013 6:07 AM, Ian Abbott wrote:
>>> @@ -84,11 +86,15 @@ static void __comedi_buf_alloc(struct comedi_device *dev,
>>>  	for (i = 0; i < n_pages; i++) {
>>>  		buf = &async->buf_page_list[i];
>>>  		if (s->async_dma_dir != DMA_NONE)
>>> +#ifdef CONFIG_HAS_DMA
>>>  			buf->virt_addr = dma_alloc_coherent(dev->hw_dev,
>>>  							    PAGE_SIZE,
>>>  							    &buf->dma_addr,
>>>  							    GFP_KERNEL |
>>>  							    __GFP_COMP);
>>> +#else
>>> +			break;
>>> +#endif
>> 
>> This break is unnecessary.
>> 
>
> You'd need something there or it would cause a parse error when
> CONFIG_HAS_DMA is disabled.  "break;" is probably as good as
> "buf->virt_addr = NULL;" or whatever.

async->buf_page_list is vzalloc'ed, so buf->virt_addr is already NULL.

Regards,
Hartley
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux