All of lore.kernel.org
 help / color / mirror / Atom feed
* Another CMA build warning
@ 2012-06-05 22:07 Russell King - ARM Linux
  2012-06-06  9:27 ` [PATCH] ARM: mm: fix type of the arm_dma_limit global variable Marek Szyprowski
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-06-05 22:07 UTC (permalink / raw)
  To: linux-arm-kernel

Here's another build warning, found by the latest OMAP randconfig build
in my build system.

arch/arm/mm/init.c:380: warning: comparison of distinct pointer types lacks a cast

caused by commit c79095092 (ARM: integrate CMA with DMA-mapping subsystem)
which adds:

+       dma_contiguous_reserve(min(arm_dma_limit, arm_lowmem_limit));


arch/arm/mm/mmu.c:phys_addr_t arm_lowmem_limit __initdata = 0;
arch/arm/mm/init.c:u32 arm_dma_limit;

Those are two potentially dis-similar types, so min() should not be used.
Use min_t() instead, or change arm_dma_limit to be phys_addr_t too, which
might make more sense.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: mm: fix type of the arm_dma_limit global variable
  2012-06-05 22:07 Another CMA build warning Russell King - ARM Linux
@ 2012-06-06  9:27 ` Marek Szyprowski
  2012-06-06  9:29   ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Szyprowski @ 2012-06-06  9:27 UTC (permalink / raw)
  To: linux-arm-kernel

arm_dma_limit stores physical address of maximal address accessible by DMA,
so the phys_addr_t type makes much more sence for it instead of u32. This
patch fixes the following build warning:

arch/arm/mm/init.c:380: warning: comparison of distinct pointer types lacks a cast

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/mm/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 8f5813b..39f2a86 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -211,7 +211,7 @@ EXPORT_SYMBOL(arm_dma_zone_size);
  * allocations.  This must be the smallest DMA mask in the system,
  * so a successful GFP_DMA allocation will always satisfy this.
  */
-u32 arm_dma_limit;
+phys_addr_t arm_dma_limit;
 
 static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
 	unsigned long dma_size)
-- 
1.7.1.569.g6f426

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: mm: fix type of the arm_dma_limit global variable
  2012-06-06  9:27 ` [PATCH] ARM: mm: fix type of the arm_dma_limit global variable Marek Szyprowski
@ 2012-06-06  9:29   ` Russell King - ARM Linux
  2012-06-06 10:35     ` [PATCHv2] " Marek Szyprowski
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-06-06  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 06, 2012 at 11:27:23AM +0200, Marek Szyprowski wrote:
> arm_dma_limit stores physical address of maximal address accessible by DMA,
> so the phys_addr_t type makes much more sence for it instead of u32. This
> patch fixes the following build warning:
> 
> arch/arm/mm/init.c:380: warning: comparison of distinct pointer types lacks a cast

I assume this is not compile tested with CONFIG_ZONE_DMA=y, because:

arch/arm/mm/mm.h:extern u32 arm_dma_limit;

would also need to be fixed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCHv2] ARM: mm: fix type of the arm_dma_limit global variable
  2012-06-06  9:29   ` Russell King - ARM Linux
@ 2012-06-06 10:35     ` Marek Szyprowski
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Szyprowski @ 2012-06-06 10:35 UTC (permalink / raw)
  To: linux-arm-kernel

arm_dma_limit stores physical address of maximal address accessible by DMA,
so the phys_addr_t type makes much more sense for it instead of u32. This
patch fixes the following build warning:

arch/arm/mm/init.c:380: warning: comparison of distinct pointer types lacks a cast

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/mm/init.c |    2 +-
 arch/arm/mm/mm.h   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index c21d06c..f54d592 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -212,7 +212,7 @@ EXPORT_SYMBOL(arm_dma_zone_size);
  * allocations.  This must be the smallest DMA mask in the system,
  * so a successful GFP_DMA allocation will always satisfy this.
  */
-u32 arm_dma_limit;
+phys_addr_t arm_dma_limit;
 
 static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
 	unsigned long dma_size)
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 93dc0c1..c471436 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -62,7 +62,7 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
 #endif
 
 #ifdef CONFIG_ZONE_DMA
-extern u32 arm_dma_limit;
+extern phys_addr_t arm_dma_limit;
 #else
 #define arm_dma_limit ((u32)~0)
 #endif
-- 
1.7.1.569.g6f426

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-06 10:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-05 22:07 Another CMA build warning Russell King - ARM Linux
2012-06-06  9:27 ` [PATCH] ARM: mm: fix type of the arm_dma_limit global variable Marek Szyprowski
2012-06-06  9:29   ` Russell King - ARM Linux
2012-06-06 10:35     ` [PATCHv2] " Marek Szyprowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.