ARM: ks8695: __arch_virt_to_dma type handling
authorArnd Bergmann <arnd@arndb.de>
Mon, 30 Apr 2012 12:17:20 +0000 (12:17 +0000)
committerArnd Bergmann <arnd@arndb.de>
Sun, 7 Oct 2012 08:33:09 +0000 (10:33 +0200)
__arch_virt_to_dma expects a virtual address pointer, but
the ks8695 implementation of this macro treats it as an
integer. Adding a type cast avoids hundreds of identical
warning messages.

Without this patch, building acs5k_defconfig results in:

arch/arm/include/asm/dma-mapping.h: In function 'virt_to_dma':
arch/arm/include/asm/dma-mapping.h:60:2: warning: passing argument 1 of '__virt_to_phys' makes integer from pointer without a cast [enabled by default]
arch/arm/include/asm/memory.h:172:60: note: expected 'long unsigned int' but argument is of type 'void *'
In file included from include/linux/dma-mapping.h:73:0,
                 from include/linux/skbuff.h:33,
                 from security/commoncap.c:21:

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Daniel Silverstone <dsilvers@simtec.co.uk>
Cc: Ben Dooks <ben-linux@fluff.org>
arch/arm/mach-ks8695/include/mach/memory.h

index f7e1b9bce345688419167f5ff6d6e0e3c00cc2f9..95e731a7ed6a5730ce29d5c8921547b433ae8652 100644 (file)
@@ -34,7 +34,8 @@ extern struct bus_type platform_bus_type;
 #define __arch_dma_to_virt(dev, x)     ({ (void *) (is_lbus_device(dev) ? \
                                        __phys_to_virt(x) : __bus_to_virt(x)); })
 #define __arch_virt_to_dma(dev, x)     ({ is_lbus_device(dev) ? \
-                                       (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); })
+                                       (dma_addr_t)__virt_to_phys((unsigned long)x) \
+                                       : (dma_addr_t)__virt_to_bus(x); })
 #define __arch_pfn_to_dma(dev, pfn)    \
        ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
           if (!is_lbus_device(dev)) \