Re: [PATCH 7/8] fsldma: rename fsl_chan to fchan

2010-01-06 Thread Ira W. Snyder
On Wed, Jan 06, 2010 at 12:27:11PM -0600, Scott Wood wrote:
> Ira W. Snyder wrote:
> > On Wed, Jan 06, 2010 at 12:04:22PM -0600, Scott Wood wrote:
> >> On Thu, Dec 31, 2009 at 10:10:45PM -0800, Ira W. Snyder wrote:
> >>> The name fsl_chan seems too long, so it has been shortened to fchan.
> >> Could be just "chan", no need for namespacing here.
> >>
> > 
> > True. A few functions have a parameter "struct dma_chan *chan" from the
> > DMAEngine API. I tried to keep the name different to avoid confusing
> > readers of the code.
> 
> Ah, I see.
> 
> I suppose "fchan" is OK in that case, or "priv", or call the dma_chan 
> "dchan", etc.
> 

Using "priv" is fine with me too, I use that style in a lot of the code
I write. I'll try "chan", and see how it works out.

Ira
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 7/8] fsldma: rename fsl_chan to fchan

2010-01-06 Thread Scott Wood

Ira W. Snyder wrote:

On Wed, Jan 06, 2010 at 12:04:22PM -0600, Scott Wood wrote:

On Thu, Dec 31, 2009 at 10:10:45PM -0800, Ira W. Snyder wrote:

The name fsl_chan seems too long, so it has been shortened to fchan.

Could be just "chan", no need for namespacing here.



True. A few functions have a parameter "struct dma_chan *chan" from the
DMAEngine API. I tried to keep the name different to avoid confusing
readers of the code.


Ah, I see.

I suppose "fchan" is OK in that case, or "priv", or call the dma_chan 
"dchan", etc.


-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 7/8] fsldma: rename fsl_chan to fchan

2010-01-06 Thread Ira W. Snyder
On Wed, Jan 06, 2010 at 12:04:22PM -0600, Scott Wood wrote:
> On Thu, Dec 31, 2009 at 10:10:45PM -0800, Ira W. Snyder wrote:
> > The name fsl_chan seems too long, so it has been shortened to fchan.
> 
> Could be just "chan", no need for namespacing here.
> 

True. A few functions have a parameter "struct dma_chan *chan" from the
DMAEngine API. I tried to keep the name different to avoid confusing
readers of the code.

Would you recommend changing everything to "struct fsldma_chan *chan",
and changing to "struct dma_chan *_chan" for the DMAEngine stuff? It
seems fine to me, and the compiler will warn about mismatched types if
you screw something up. The struct dma_chan isn't used for anything
except container_of() anyway.

Ira
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 7/8] fsldma: rename fsl_chan to fchan

2010-01-06 Thread Scott Wood
On Thu, Dec 31, 2009 at 10:10:45PM -0800, Ira W. Snyder wrote:
> The name fsl_chan seems too long, so it has been shortened to fchan.

Could be just "chan", no need for namespacing here.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 7/8] fsldma: rename fsl_chan to fchan

2009-12-31 Thread Ira W. Snyder
The name fsl_chan seems too long, so it has been shortened to fchan.

Signed-off-by: Ira W. Snyder 
---
 drivers/dma/fsldma.c |  446 +-
 1 files changed, 223 insertions(+), 223 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index d8cc05b..f65b28b 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -37,19 +37,19 @@
 #include 
 #include "fsldma.h"
 
-static void dma_init(struct fsldma_chan *fsl_chan)
+static void dma_init(struct fsldma_chan *fchan)
 {
/* Reset the channel */
-   DMA_OUT(fsl_chan, &fsl_chan->regs->mr, 0, 32);
+   DMA_OUT(fchan, &fchan->regs->mr, 0, 32);
 
-   switch (fsl_chan->feature & FSL_DMA_IP_MASK) {
+   switch (fchan->feature & FSL_DMA_IP_MASK) {
case FSL_DMA_IP_85XX:
/* Set the channel to below modes:
 * EIE - Error interrupt enable
 * EOSIE - End of segments interrupt enable (basic mode)
 * EOLNIE - End of links interrupt enable
 */
-   DMA_OUT(fsl_chan, &fsl_chan->regs->mr, FSL_DMA_MR_EIE
+   DMA_OUT(fchan, &fchan->regs->mr, FSL_DMA_MR_EIE
| FSL_DMA_MR_EOLNIE | FSL_DMA_MR_EOSIE, 32);
break;
case FSL_DMA_IP_83XX:
@@ -57,154 +57,154 @@ static void dma_init(struct fsldma_chan *fsl_chan)
 * EOTIE - End-of-transfer interrupt enable
 * PRC_RM - PCI read multiple
 */
-   DMA_OUT(fsl_chan, &fsl_chan->regs->mr, FSL_DMA_MR_EOTIE
+   DMA_OUT(fchan, &fchan->regs->mr, FSL_DMA_MR_EOTIE
| FSL_DMA_MR_PRC_RM, 32);
break;
}
 
 }
 
-static void set_sr(struct fsldma_chan *fsl_chan, u32 val)
+static void set_sr(struct fsldma_chan *fchan, u32 val)
 {
-   DMA_OUT(fsl_chan, &fsl_chan->regs->sr, val, 32);
+   DMA_OUT(fchan, &fchan->regs->sr, val, 32);
 }
 
-static u32 get_sr(struct fsldma_chan *fsl_chan)
+static u32 get_sr(struct fsldma_chan *fchan)
 {
-   return DMA_IN(fsl_chan, &fsl_chan->regs->sr, 32);
+   return DMA_IN(fchan, &fchan->regs->sr, 32);
 }
 
-static void set_desc_cnt(struct fsldma_chan *fsl_chan,
+static void set_desc_cnt(struct fsldma_chan *fchan,
struct fsl_dma_ld_hw *hw, u32 count)
 {
-   hw->count = CPU_TO_DMA(fsl_chan, count, 32);
+   hw->count = CPU_TO_DMA(fchan, count, 32);
 }
 
-static void set_desc_src(struct fsldma_chan *fsl_chan,
+static void set_desc_src(struct fsldma_chan *fchan,
struct fsl_dma_ld_hw *hw, dma_addr_t src)
 {
u64 snoop_bits;
 
-   snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX)
+   snoop_bits = ((fchan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX)
? ((u64)FSL_DMA_SATR_SREADTYPE_SNOOP_READ << 32) : 0;
-   hw->src_addr = CPU_TO_DMA(fsl_chan, snoop_bits | src, 64);
+   hw->src_addr = CPU_TO_DMA(fchan, snoop_bits | src, 64);
 }
 
-static void set_desc_dst(struct fsldma_chan *fsl_chan,
+static void set_desc_dst(struct fsldma_chan *fchan,
struct fsl_dma_ld_hw *hw, dma_addr_t dst)
 {
u64 snoop_bits;
 
-   snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX)
+   snoop_bits = ((fchan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX)
? ((u64)FSL_DMA_DATR_DWRITETYPE_SNOOP_WRITE << 32) : 0;
-   hw->dst_addr = CPU_TO_DMA(fsl_chan, snoop_bits | dst, 64);
+   hw->dst_addr = CPU_TO_DMA(fchan, snoop_bits | dst, 64);
 }
 
-static void set_desc_next(struct fsldma_chan *fsl_chan,
+static void set_desc_next(struct fsldma_chan *fchan,
struct fsl_dma_ld_hw *hw, dma_addr_t next)
 {
u64 snoop_bits;
 
-   snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX)
+   snoop_bits = ((fchan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX)
? FSL_DMA_SNEN : 0;
-   hw->next_ln_addr = CPU_TO_DMA(fsl_chan, snoop_bits | next, 64);
+   hw->next_ln_addr = CPU_TO_DMA(fchan, snoop_bits | next, 64);
 }
 
-static void set_cdar(struct fsldma_chan *fsl_chan, dma_addr_t addr)
+static void set_cdar(struct fsldma_chan *fchan, dma_addr_t addr)
 {
-   DMA_OUT(fsl_chan, &fsl_chan->regs->cdar, addr | FSL_DMA_SNEN, 64);
+   DMA_OUT(fchan, &fchan->regs->cdar, addr | FSL_DMA_SNEN, 64);
 }
 
-static dma_addr_t get_cdar(struct fsldma_chan *fsl_chan)
+static dma_addr_t get_cdar(struct fsldma_chan *fchan)
 {
-   return DMA_IN(fsl_chan, &fsl_chan->regs->cdar, 64) & ~FSL_DMA_SNEN;
+   return DMA_IN(fchan, &fchan->regs->cdar, 64) & ~FSL_DMA_SNEN;
 }
 
-static void set_ndar(struct fsldma_chan *fsl_chan, dma_addr_t addr)
+static void set_ndar(struct fsldma_chan *fchan, dma_addr_t addr)
 {
-   DMA_OUT(fsl_chan, &fsl_chan->regs->ndar, addr, 64);
+   DMA_OUT(fchan, &fchan->regs->ndar, add