LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Fix fsldma.c warning messages when it's compiled under PPC64.
@ 2008-03-10 10:47 Zhang Wei
2008-03-10 19:09 ` Dan Williams
2008-03-11 14:22 ` Olof Johansson
0 siblings, 2 replies; 8+ messages in thread
From: Zhang Wei @ 2008-03-10 10:47 UTC (permalink / raw)
To: dan.j.williams, sfr; +Cc: linux-kernel, Zhang Wei
There are warning messages reported by Stephen Rothwell with
ARCH=powerpc allmodconfig build:
drivers/dma/fsldma.c: In function 'fsl_dma_prep_memcpy':
drivers/dma/fsldma.c:439: warning: comparison of distinct pointer types
lacks a cast
drivers/dma/fsldma.c: In function 'fsl_chan_xfer_ld_queue':
drivers/dma/fsldma.c:584: warning: format '%016llx' expects type 'long long
unsigned int', but argument 4 has type 'dma_addr_t'
drivers/dma/fsldma.c: In function 'fsl_dma_chan_do_interrupt':
drivers/dma/fsldma.c:668: warning: format '%x' expects type 'unsigned int',
but argument 5 has type 'dma_addr_t'
drivers/dma/fsldma.c:684: warning: format '%016llx' expects type 'long long
unsigned int', but argument 4 has type 'dma_addr_t'
drivers/dma/fsldma.c:684: warning: format '%016llx' expects type 'long long
unsigned int', but argument 5 has type 'dma_addr_t'
drivers/dma/fsldma.c:701: warning: format '%02x' expects type 'unsigned
int', but argument 4 has type 'dma_addr_t'
drivers/dma/fsldma.c: In function 'fsl_dma_self_test':
drivers/dma/fsldma.c:840: warning: format '%d' expects type 'int', but
argument 5 has type 'size_t'
drivers/dma/fsldma.c: In function 'of_fsl_dma_probe':
drivers/dma/fsldma.c:1010: warning: format '%08x' expects type 'unsigned
int', but argument 5 has type 'resource_size_t'
This patch fixed the above warning messages.
Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
---
drivers/dma/fsldma.c | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index cc9a681..5dfedf3 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -57,12 +57,12 @@ static void dma_init(struct fsl_dma_chan *fsl_chan)
}
-static void set_sr(struct fsl_dma_chan *fsl_chan, dma_addr_t val)
+static void set_sr(struct fsl_dma_chan *fsl_chan, u32 val)
{
DMA_OUT(fsl_chan, &fsl_chan->reg_base->sr, val, 32);
}
-static dma_addr_t get_sr(struct fsl_dma_chan *fsl_chan)
+static u32 get_sr(struct fsl_dma_chan *fsl_chan)
{
return DMA_IN(fsl_chan, &fsl_chan->reg_base->sr, 32);
}
@@ -436,7 +436,7 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new);
#endif
- copy = min(len, FSL_DMA_BCR_MAX_CNT);
+ copy = min(len, (size_t)FSL_DMA_BCR_MAX_CNT);
set_desc_cnt(fsl_chan, &new->hw, copy);
set_desc_src(fsl_chan, &new->hw, dma_src);
@@ -581,8 +581,8 @@ static void fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan)
if (ld_node != &fsl_chan->ld_queue) {
/* Get the ld start address from ld_queue */
next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys;
- dev_dbg(fsl_chan->dev, "xfer LDs staring from 0x%016llx\n",
- (u64)next_dest_addr);
+ dev_dbg(fsl_chan->dev, "xfer LDs staring from %p\n",
+ (void *)next_dest_addr);
set_cdar(fsl_chan, next_dest_addr);
dma_start(fsl_chan);
} else {
@@ -662,7 +662,7 @@ static enum dma_status fsl_dma_is_complete(struct dma_chan *chan,
static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
{
struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
- dma_addr_t stat;
+ u32 stat;
stat = get_sr(fsl_chan);
dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n",
@@ -681,9 +681,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
*/
if (stat & FSL_DMA_SR_EOSI) {
dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n");
- dev_dbg(fsl_chan->dev, "event: clndar 0x%016llx, "
- "nlndar 0x%016llx\n", (u64)get_cdar(fsl_chan),
- (u64)get_ndar(fsl_chan));
+ dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n",
+ (void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan));
stat &= ~FSL_DMA_SR_EOSI;
}
@@ -726,12 +725,15 @@ static void dma_do_tasklet(unsigned long data)
fsl_chan_ld_cleanup(fsl_chan);
}
+#ifdef FSL_DMA_CALLBACKTEST
static void fsl_dma_callback_test(struct fsl_dma_chan *fsl_chan)
{
if (fsl_chan)
dev_info(fsl_chan->dev, "selftest: callback is ok!\n");
}
+#endif
+#ifdef CONFIG_FSL_DMA_SELFTEST
static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan)
{
struct dma_chan *chan;
@@ -837,9 +839,9 @@ static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan)
if (err) {
for (i = 0; (*(src + i) == *(dest + i)) && (i < test_size);
i++);
- dev_err(fsl_chan->dev, "selftest: Test failed, data %d/%d is "
+ dev_err(fsl_chan->dev, "selftest: Test failed, data %d/%ld is "
"error! src 0x%x, dest 0x%x\n",
- i, test_size, *(src + i), *(dest + i));
+ i, (long)test_size, *(src + i), *(dest + i));
}
free_resources:
@@ -848,6 +850,7 @@ out:
kfree(src);
return err;
}
+#endif
static int __devinit of_fsl_dma_chan_probe(struct of_device *dev,
const struct of_device_id *match)
@@ -1008,8 +1011,8 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
}
dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
- "controller at 0x%08x...\n",
- match->compatible, fdev->reg.start);
+ "controller at %p...\n",
+ match->compatible, (void *)fdev->reg.start);
fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end
- fdev->reg.start + 1);
--
1.5.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Fix fsldma.c warning messages when it's compiled under PPC64.
2008-03-10 10:47 [PATCH] Fix fsldma.c warning messages when it's compiled under PPC64 Zhang Wei
@ 2008-03-10 19:09 ` Dan Williams
2008-03-11 14:22 ` Olof Johansson
1 sibling, 0 replies; 8+ messages in thread
From: Dan Williams @ 2008-03-10 19:09 UTC (permalink / raw)
To: Zhang Wei; +Cc: sfr, linux-kernel
On Mon, Mar 10, 2008 at 3:47 AM, Zhang Wei <wei.zhang@freescale.com> wrote:
> There are warning messages reported by Stephen Rothwell with
> ARCH=powerpc allmodconfig build:
[..]
> This patch fixed the above warning messages.
>
> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Thanks, this is applied and pushed back out on async_tx.git#next.
--
Dan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Fix fsldma.c warning messages when it's compiled under PPC64.
2008-03-10 10:47 [PATCH] Fix fsldma.c warning messages when it's compiled under PPC64 Zhang Wei
2008-03-10 19:09 ` Dan Williams
@ 2008-03-11 14:22 ` Olof Johansson
2008-03-12 2:10 ` [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64 Zhang Wei
1 sibling, 1 reply; 8+ messages in thread
From: Olof Johansson @ 2008-03-11 14:22 UTC (permalink / raw)
To: Zhang Wei; +Cc: dan.j.williams, sfr, linux-kernel
On Mon, Mar 10, 2008 at 06:47:25PM +0800, Zhang Wei wrote:
> There are warning messages reported by Stephen Rothwell with
> ARCH=powerpc allmodconfig build:
>
> drivers/dma/fsldma.c: In function 'fsl_dma_prep_memcpy':
> drivers/dma/fsldma.c:439: warning: comparison of distinct pointer types
> lacks a cast
> drivers/dma/fsldma.c: In function 'fsl_chan_xfer_ld_queue':
> drivers/dma/fsldma.c:584: warning: format '%016llx' expects type 'long long
> unsigned int', but argument 4 has type 'dma_addr_t'
> drivers/dma/fsldma.c: In function 'fsl_dma_chan_do_interrupt':
> drivers/dma/fsldma.c:668: warning: format '%x' expects type 'unsigned int',
> but argument 5 has type 'dma_addr_t'
> drivers/dma/fsldma.c:684: warning: format '%016llx' expects type 'long long
> unsigned int', but argument 4 has type 'dma_addr_t'
> drivers/dma/fsldma.c:684: warning: format '%016llx' expects type 'long long
> unsigned int', but argument 5 has type 'dma_addr_t'
> drivers/dma/fsldma.c:701: warning: format '%02x' expects type 'unsigned
> int', but argument 4 has type 'dma_addr_t'
> drivers/dma/fsldma.c: In function 'fsl_dma_self_test':
> drivers/dma/fsldma.c:840: warning: format '%d' expects type 'int', but
> argument 5 has type 'size_t'
> drivers/dma/fsldma.c: In function 'of_fsl_dma_probe':
> drivers/dma/fsldma.c:1010: warning: format '%08x' expects type 'unsigned
> int', but argument 5 has type 'resource_size_t'
>
> This patch fixed the above warning messages.
>
> Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> ---
> drivers/dma/fsldma.c | 29 ++++++++++++++++-------------
> 1 files changed, 16 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index cc9a681..5dfedf3 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -57,12 +57,12 @@ static void dma_init(struct fsl_dma_chan *fsl_chan)
>
> }
>
> -static void set_sr(struct fsl_dma_chan *fsl_chan, dma_addr_t val)
> +static void set_sr(struct fsl_dma_chan *fsl_chan, u32 val)
Why? dma_addr_t is the right type to use here.
> {
> DMA_OUT(fsl_chan, &fsl_chan->reg_base->sr, val, 32);
> }
>
> -static dma_addr_t get_sr(struct fsl_dma_chan *fsl_chan)
> +static u32 get_sr(struct fsl_dma_chan *fsl_chan)
> {
> return DMA_IN(fsl_chan, &fsl_chan->reg_base->sr, 32);
> }
> @@ -436,7 +436,7 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
> dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new);
> #endif
>
> - copy = min(len, FSL_DMA_BCR_MAX_CNT);
> + copy = min(len, (size_t)FSL_DMA_BCR_MAX_CNT);
>
> set_desc_cnt(fsl_chan, &new->hw, copy);
> set_desc_src(fsl_chan, &new->hw, dma_src);
> @@ -581,8 +581,8 @@ static void fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan)
> if (ld_node != &fsl_chan->ld_queue) {
> /* Get the ld start address from ld_queue */
> next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys;
> - dev_dbg(fsl_chan->dev, "xfer LDs staring from 0x%016llx\n",
> - (u64)next_dest_addr);
> + dev_dbg(fsl_chan->dev, "xfer LDs staring from %p\n",
> + (void *)next_dest_addr);
If anything you should cast to unsigned long and print as %lx.
next_dest_addr is not a pointer, it's a bus/dma address.
Same for all the other changes in this file (dma_addr_t -> u32 doesn't
seem right, same for the %llx -> %p changes).
-Olof
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64.
2008-03-11 14:22 ` Olof Johansson
@ 2008-03-12 2:10 ` Zhang Wei
2008-03-12 16:29 ` Dan Williams
0 siblings, 1 reply; 8+ messages in thread
From: Zhang Wei @ 2008-03-12 2:10 UTC (permalink / raw)
To: Olof Johansson; +Cc: dan.j.williams, sfr, linux-kernel
Hi,
> -----Original Message-----
> From: Olof Johansson [mailto:olof@lixom.net]
>
> On Mon, Mar 10, 2008 at 06:47:25PM +0800, Zhang Wei wrote:
> > There are warning messages reported by Stephen Rothwell with
> > ARCH=powerpc allmodconfig build:
> >
> > drivers/dma/fsldma.c: In function 'fsl_dma_prep_memcpy':
> > drivers/dma/fsldma.c:439: warning: comparison of distinct
> pointer types
> > lacks a cast
> > drivers/dma/fsldma.c: In function 'fsl_chan_xfer_ld_queue':
> > drivers/dma/fsldma.c:584: warning: format '%016llx' expects
> type 'long long
> > unsigned int', but argument 4 has type 'dma_addr_t'
> > drivers/dma/fsldma.c: In function 'fsl_dma_chan_do_interrupt':
> > drivers/dma/fsldma.c:668: warning: format '%x' expects type
> 'unsigned int',
> > but argument 5 has type 'dma_addr_t'
> > drivers/dma/fsldma.c:684: warning: format '%016llx' expects
> type 'long long
> > unsigned int', but argument 4 has type 'dma_addr_t'
> > drivers/dma/fsldma.c:684: warning: format '%016llx' expects
> type 'long long
> > unsigned int', but argument 5 has type 'dma_addr_t'
> > drivers/dma/fsldma.c:701: warning: format '%02x' expects
> type 'unsigned
> > int', but argument 4 has type 'dma_addr_t'
> > drivers/dma/fsldma.c: In function 'fsl_dma_self_test':
> > drivers/dma/fsldma.c:840: warning: format '%d' expects type
> 'int', but
> > argument 5 has type 'size_t'
> > drivers/dma/fsldma.c: In function 'of_fsl_dma_probe':
> > drivers/dma/fsldma.c:1010: warning: format '%08x' expects
> type 'unsigned
> > int', but argument 5 has type 'resource_size_t'
> >
> > This patch fixed the above warning messages.
> >
> > Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
> > ---
> > drivers/dma/fsldma.c | 29 ++++++++++++++++-------------
> > 1 files changed, 16 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> > index cc9a681..5dfedf3 100644
> > --- a/drivers/dma/fsldma.c
> > +++ b/drivers/dma/fsldma.c
> > @@ -57,12 +57,12 @@ static void dma_init(struct
> fsl_dma_chan *fsl_chan)
> >
> > }
> >
> > -static void set_sr(struct fsl_dma_chan *fsl_chan, dma_addr_t val)
> > +static void set_sr(struct fsl_dma_chan *fsl_chan, u32 val)
>
> Why? dma_addr_t is the right type to use here.
The reason is the val will be assigned to SR register, and SR register
is a 32-bit only register.
> > @@ -581,8 +581,8 @@ static void
> fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan)
> > if (ld_node != &fsl_chan->ld_queue) {
> > /* Get the ld start address from ld_queue */
> > next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys;
> > - dev_dbg(fsl_chan->dev, "xfer LDs staring from
> 0x%016llx\n",
> > - (u64)next_dest_addr);
> > + dev_dbg(fsl_chan->dev, "xfer LDs staring from %p\n",
> > + (void *)next_dest_addr);
>
> If anything you should cast to unsigned long and print as %lx.
> next_dest_addr is not a pointer, it's a bus/dma address.
>
> Same for all the other changes in this file (dma_addr_t -> u32 doesn't
> seem right, same for the %llx -> %p changes).
>
Here's cast is only for print out message. The type point can
adapt the address width automatically in 32-bit and 64-bit kernel.
Thanks!
Wei.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64.
2008-03-12 2:10 ` [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64 Zhang Wei
@ 2008-03-12 16:29 ` Dan Williams
2008-03-13 6:52 ` Zhang Wei
0 siblings, 1 reply; 8+ messages in thread
From: Dan Williams @ 2008-03-12 16:29 UTC (permalink / raw)
To: Zhang Wei; +Cc: Olof Johansson, sfr, linux-kernel
On Tue, Mar 11, 2008 at 7:10 PM, Zhang Wei <Wei.Zhang@freescale.com> wrote:
> The reason is the val will be assigned to SR register, and SR register
> is a 32-bit only register.
If this is the case then why not disable the driver for PPC_64?
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 27340a7..89db937 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -40,6 +40,7 @@ config INTEL_IOP_ADMA
config FSL_DMA
bool "Freescale MPC85xx/MPC83xx DMA support"
depends on PPC
+ depends on !PPC_64
select DMA_ENGINE
---help---
Enable support for the Freescale DMA engine. Now, it support
--
Dan
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64.
2008-03-12 16:29 ` Dan Williams
@ 2008-03-13 6:52 ` Zhang Wei
2008-03-18 18:23 ` Scott Wood
0 siblings, 1 reply; 8+ messages in thread
From: Zhang Wei @ 2008-03-13 6:52 UTC (permalink / raw)
To: Dan Williams; +Cc: Olof Johansson, sfr, linux-kernel
Hi, Dan,
I just consider if it could be reused on Freescale's 64bit processor in the future.
If we don't care this, I can let the driver only depends on PPC32.
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 27340a7..449c0ae 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -39,7 +39,7 @@ config INTEL_IOP_ADMA
config FSL_DMA
bool "Freescale MPC85xx/MPC83xx DMA support"
- depends on PPC
+ depends on PPC32
select DMA_ENGINE
---help---
Enable support for the Freescale DMA engine. Now, it support
Thanks!
Wei.
> -----Original Message-----
> From: dan.j.williams@gmail.com
>
> On Tue, Mar 11, 2008 at 7:10 PM, Zhang Wei
> <Wei.Zhang@freescale.com> wrote:
> > The reason is the val will be assigned to SR register, and
> SR register
> > is a 32-bit only register.
>
> If this is the case then why not disable the driver for PPC_64?
>
> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
> index 27340a7..89db937 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -40,6 +40,7 @@ config INTEL_IOP_ADMA
> config FSL_DMA
> bool "Freescale MPC85xx/MPC83xx DMA support"
> depends on PPC
> + depends on !PPC_64
> select DMA_ENGINE
> ---help---
> Enable support for the Freescale DMA engine. Now, it support
>
> --
> Dan
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64.
2008-03-13 6:52 ` Zhang Wei
@ 2008-03-18 18:23 ` Scott Wood
2008-03-19 1:52 ` Zhang Wei
0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2008-03-18 18:23 UTC (permalink / raw)
To: Zhang Wei; +Cc: Dan Williams, Olof Johansson, sfr, linux-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64.
2008-03-18 18:23 ` Scott Wood
@ 2008-03-19 1:52 ` Zhang Wei
0 siblings, 0 replies; 8+ messages in thread
From: Zhang Wei @ 2008-03-19 1:52 UTC (permalink / raw)
To: Wood Scott; +Cc: Dan Williams, Olof Johansson, sfr, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 587 bytes --]
> -----Original Message-----
> From: Wood Scott
>
> >>> The reason is the val will be assigned to SR register, and
> >> SR register
> >>> is a 32-bit only register.
> >> If this is the case then why not disable the driver for PPC_64?
>
> May I point out that SR is a status register, and not an address, and
> thus it should never have been dma_addr_t to begin with?
>
Never, thus u32 is good for SR.
Cheers!
Wei.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-03-19 21:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-10 10:47 [PATCH] Fix fsldma.c warning messages when it's compiled under PPC64 Zhang Wei
2008-03-10 19:09 ` Dan Williams
2008-03-11 14:22 ` Olof Johansson
2008-03-12 2:10 ` [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64 Zhang Wei
2008-03-12 16:29 ` Dan Williams
2008-03-13 6:52 ` Zhang Wei
2008-03-18 18:23 ` Scott Wood
2008-03-19 1:52 ` Zhang Wei
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).