Re: [RFC PATCH] dma: at_xdmac: creation of the atmel eXtended DMA Controller driver

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

 



On Wednesday 11 June 2014 10:12:48 Ludovic Desroches wrote:
> I have noticed that the filter function was missing in the RFC version.
> I had to add it since there are two xdma controllers in the system.
> 
> static bool at_xdmac_filter(struct dma_chan *chan, void *slave)                 
> {                                                                               
>         struct device *dma_dev = (struct device *) slave;                       
>                                                                                 
>         if (dma_dev == chan->device->dev)                                       
>                 return true;                                                    
>         else                                                                    
>                 return false;                                                   
> }

Yes, looks good. Note that you can save the typecast and just do

	struct device *dma_dev = slave; 
	if (chan->device->dev == dma_dev)
		...

or shorter

	if (chan->device->dev == slave)
		...

or shortest:

	return chan->device->dev == slave;

I find the shorter versions more readable here, but any of these
are correct.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux