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 ...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 --
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. --
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
--
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!
--
IA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFdvb2QgU2NvdHQgDQo+ IA0KPiA+Pj4gIFRoZSByZWFzb24gaXMgdGhlIHZhbCB3aWxsIGJlIGFzc2lnbmVkIHRvIFNSIHJl Z2lzdGVyLCBhbmQgDQo+ID4+IFNSIHJlZ2lzdGVyDQo+ID4+PiAgIGlzIGEgMzItYml0IG9ubHkg cmVnaXN0ZXIuDQo+ID4+IElmIHRoaXMgaXMgdGhlIGNhc2UgdGhlbiB3aHkgbm90IGRpc2FibGUg dGhlIGRyaXZlciBmb3IgUFBDXzY0Pw0KPiANCj4gTWF5IEkgcG9pbnQgb3V0IHRoYXQgU1IgaXMg YSBzdGF0dXMgcmVnaXN0ZXIsIGFuZCBub3QgYW4gYWRkcmVzcywgYW5kIA0KPiB0aHVzIGl0IHNo b3VsZCBuZXZlciBoYXZlIGJlZW4gZG1hX2FkZHJfdCB0byBiZWdpbiB3aXRoPw0KPiANCk5ldmVy LCB0aHVzIHUzMiBpcyBnb29kIGZvciBTUi4NCg0KQ2hlZXJzIQ0KV2VpLg0K --
Thanks, this is applied and pushed back out on async_tx.git#next. -- Dan --
