RE: [PATCH] Fix fsldma.c warning messages when it's compiled underPPC64.

Previous thread: dev_queue_xmit question by Pierre Falda on Monday, March 10, 2008 - 3:31 am. (1 message)

Next thread: [PATCH] x86: Don't send RESCHEDULE_VECTOR to offlined cpus by Gautham R Shenoy on Monday, March 10, 2008 - 5:14 am. (6 messages)
From: Zhang Wei
Date: Monday, March 10, 2008 - 3:47 am

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 ...
From: Olof Johansson
Date: Tuesday, March 11, 2008 - 7:22 am

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
--

From: Zhang Wei
Date: Tuesday, March 11, 2008 - 7:10 pm

The reason is the val will be assigned to SR register, and SR register

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.
--

From: Dan Williams
Date: Wednesday, March 12, 2008 - 9:29 am

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
--

From: Zhang Wei
Date: Wednesday, March 12, 2008 - 11:52 pm

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!
--

From: Scott Wood
Date: Tuesday, March 18, 2008 - 11:23 am

From: Zhang Wei
Date: Tuesday, March 18, 2008 - 6:52 pm

IA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFdvb2QgU2NvdHQgDQo+
IA0KPiA+Pj4gIFRoZSByZWFzb24gaXMgdGhlIHZhbCB3aWxsIGJlIGFzc2lnbmVkIHRvIFNSIHJl
Z2lzdGVyLCBhbmQgDQo+ID4+IFNSIHJlZ2lzdGVyDQo+ID4+PiAgIGlzIGEgMzItYml0IG9ubHkg
cmVnaXN0ZXIuDQo+ID4+IElmIHRoaXMgaXMgdGhlIGNhc2UgdGhlbiB3aHkgbm90IGRpc2FibGUg
dGhlIGRyaXZlciBmb3IgUFBDXzY0Pw0KPiANCj4gTWF5IEkgcG9pbnQgb3V0IHRoYXQgU1IgaXMg
YSBzdGF0dXMgcmVnaXN0ZXIsIGFuZCBub3QgYW4gYWRkcmVzcywgYW5kIA0KPiB0aHVzIGl0IHNo
b3VsZCBuZXZlciBoYXZlIGJlZW4gZG1hX2FkZHJfdCB0byBiZWdpbiB3aXRoPw0KPiANCk5ldmVy
LCB0aHVzIHUzMiBpcyBnb29kIGZvciBTUi4NCg0KQ2hlZXJzIQ0KV2VpLg0K
--

From: Dan Williams
Date: Monday, March 10, 2008 - 12:09 pm

Thanks, this is applied and pushed back out on async_tx.git#next.

--
Dan
--

Previous thread: dev_queue_xmit question by Pierre Falda on Monday, March 10, 2008 - 3:31 am. (1 message)

Next thread: [PATCH] x86: Don't send RESCHEDULE_VECTOR to offlined cpus by Gautham R Shenoy on Monday, March 10, 2008 - 5:14 am. (6 messages)