linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] dma: at_xdmac: creation of the atmel eXtended DMA Controller driver
Date: Wed, 11 Jun 2014 11:04:21 +0200	[thread overview]
Message-ID: <4675005.TnHGXm92zV@wuerfel> (raw)
In-Reply-To: <20140611081248.GS1701@ldesroches-Latitude-E6320>

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

  reply	other threads:[~2014-06-11  9:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  8:35 [RFC PATCH] dma: at_xdmac: creation of the atmel eXtended DMA Controller driver Ludovic Desroches
2014-05-29 10:04 ` Josh Wu
2014-06-10 15:41 ` Maxime Ripard
2014-06-10 17:58   ` Arnd Bergmann
2014-06-10 19:15   ` Arnd Bergmann
2014-06-11  7:35     ` Ludovic Desroches
2014-06-11  7:41       ` Arnd Bergmann
2014-06-11  8:12         ` Ludovic Desroches
2014-06-11  9:04           ` Arnd Bergmann [this message]
2014-06-11  7:59   ` Ludovic Desroches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4675005.TnHGXm92zV@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).