Commit 1562f98f authored by Russell King's avatar Russell King Committed by Russell King

[ARM] Fix IOP13xx build warnings

http://armlinux.simtec.co.uk/kautobuild/2.6.27-rc5/iop13xx_defconfig/zimage.log

Occurrences  Warning text
339  arch/arm/include/asm/dma-mapping.h:40: warning: return makes pointer from integer without a cast
203  arch/arm/include/asm/dma-mapping.h:45: warning: return makes integer from pointer without a cast
Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 80cec14a
...@@ -26,32 +26,52 @@ ...@@ -26,32 +26,52 @@
/* RAM has 1:1 mapping on the PCIe/x Busses */ /* RAM has 1:1 mapping on the PCIe/x Busses */
#define __virt_to_bus(x) (__virt_to_phys(x)) #define __virt_to_bus(x) (__virt_to_phys(x))
#define __bus_to_virt(x) (__phys_to_virt(x)) #define __bus_to_virt(x) (__phys_to_virt(x))
#define virt_to_lbus(x) \ static inline dma_addr_t __virt_to_lbus(unsigned long x)
(( ((void*)(x) >= (void*)IOP13XX_PMMR_V_START) && \ {
((void*)(x) < (void*)IOP13XX_PMMR_V_END) ) ? \ return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE;
((x) - IOP13XX_PMMR_VIRT_MEM_BASE + IOP13XX_PMMR_PHYS_MEM_BASE) : \ }
((x) - PAGE_OFFSET + PHYS_OFFSET))
#define lbus_to_virt(x) \ static inline unsigned long __lbus_to_virt(dma_addr_t x)
(( ((x) >= IOP13XX_PMMR_P_START) && ((x) < IOP13XX_PMMR_P_END) ) ? \ {
((x) - IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_VIRT_MEM_BASE ) : \ return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE;
((x) - PHYS_OFFSET + PAGE_OFFSET)) }
#define __is_lbus_dma(a) \
((a) >= IOP13XX_PMMR_P_START && (a) < IOP13XX_PMMR_P_END)
#define __is_lbus_virt(a) \
((a) >= IOP13XX_PMMR_V_START && (a) < IOP13XX_PMMR_V_END)
/* Device is an lbus device if it is on the platform bus of the IOP13XX */ /* Device is an lbus device if it is on the platform bus of the IOP13XX */
#define is_lbus_device(dev) (dev &&\ #define is_lbus_device(dev) \
(strncmp(dev->bus->name, "platform", 8) == 0)) (dev && strncmp(dev->bus->name, "platform", 8) == 0)
#define __arch_page_to_dma(dev, page) \ #define __arch_dma_to_virt(dev, addr) \
({is_lbus_device(dev) ? (dma_addr_t)virt_to_lbus(page_address(page)) : \ ({ \
(dma_addr_t)__virt_to_bus(page_address(page));}) unsigned long __virt; \
dma_addr_t __dma = addr; \
if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \
__virt = __lbus_to_virt(__dma); \
else \
__virt = __bus_to_virt(__dma); \
(void *)__virt; \
})
#define __arch_dma_to_virt(dev, addr) \ #define __arch_virt_to_dma(dev, addr) \
({is_lbus_device(dev) ? lbus_to_virt(addr) : __bus_to_virt(addr);}) ({ \
unsigned long __virt = (unsigned long)addr; \
dma_addr_t __dma; \
if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \
__dma = __virt_to_lbus(__virt); \
else \
__dma = __virt_to_bus(__virt); \
__dma; \
})
#define __arch_virt_to_dma(dev, addr) \ #define __arch_page_to_dma(dev, page) \
({is_lbus_device(dev) ? virt_to_lbus(addr) : __virt_to_bus(addr);}) __arch_virt_to_dma(dev, page_address(page))
#endif /* CONFIG_ARCH_IOP13XX */ #endif /* CONFIG_ARCH_IOP13XX */
#endif /* !ASSEMBLY */ #endif /* !ASSEMBLY */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment