diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-17 15:36:49 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-17 15:36:49 -0400 |
commit | 1562f98f918f2de7549edbaaabdb8bece52320f0 (patch) | |
tree | f306e56f3b991fd32df2f7e8cccc07315c15afd9 /arch/arm/mach-iop13xx/include | |
parent | 80cec14a83ad0ad109d822b3f3482a379bc481ba (diff) |
[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: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-iop13xx/include')
-rw-r--r-- | arch/arm/mach-iop13xx/include/mach/memory.h | 58 |
1 files changed, 39 insertions, 19 deletions
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h index a74b027432d2..b82602d529bf 100644 --- a/arch/arm/mach-iop13xx/include/mach/memory.h +++ b/arch/arm/mach-iop13xx/include/mach/memory.h | |||
@@ -26,32 +26,52 @@ | |||
26 | 26 | ||
27 | /* RAM has 1:1 mapping on the PCIe/x Busses */ | 27 | /* RAM has 1:1 mapping on the PCIe/x Busses */ |
28 | #define __virt_to_bus(x) (__virt_to_phys(x)) | 28 | #define __virt_to_bus(x) (__virt_to_phys(x)) |
29 | #define __bus_to_virt(x) (__phys_to_virt(x)) | 29 | #define __bus_to_virt(x) (__phys_to_virt(x)) |
30 | 30 | ||
31 | #define virt_to_lbus(x) \ | 31 | static inline dma_addr_t __virt_to_lbus(unsigned long x) |
32 | (( ((void*)(x) >= (void*)IOP13XX_PMMR_V_START) && \ | 32 | { |
33 | ((void*)(x) < (void*)IOP13XX_PMMR_V_END) ) ? \ | 33 | return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE; |
34 | ((x) - IOP13XX_PMMR_VIRT_MEM_BASE + IOP13XX_PMMR_PHYS_MEM_BASE) : \ | 34 | } |
35 | ((x) - PAGE_OFFSET + PHYS_OFFSET)) | ||
36 | 35 | ||
37 | #define lbus_to_virt(x) \ | 36 | static inline unsigned long __lbus_to_virt(dma_addr_t x) |
38 | (( ((x) >= IOP13XX_PMMR_P_START) && ((x) < IOP13XX_PMMR_P_END) ) ? \ | 37 | { |
39 | ((x) - IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_VIRT_MEM_BASE ) : \ | 38 | return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE; |
40 | ((x) - PHYS_OFFSET + PAGE_OFFSET)) | 39 | } |
40 | |||
41 | #define __is_lbus_dma(a) \ | ||
42 | ((a) >= IOP13XX_PMMR_P_START && (a) < IOP13XX_PMMR_P_END) | ||
43 | |||
44 | #define __is_lbus_virt(a) \ | ||
45 | ((a) >= IOP13XX_PMMR_V_START && (a) < IOP13XX_PMMR_V_END) | ||
41 | 46 | ||
42 | /* Device is an lbus device if it is on the platform bus of the IOP13XX */ | 47 | /* Device is an lbus device if it is on the platform bus of the IOP13XX */ |
43 | #define is_lbus_device(dev) (dev &&\ | 48 | #define is_lbus_device(dev) \ |
44 | (strncmp(dev->bus->name, "platform", 8) == 0)) | 49 | (dev && strncmp(dev->bus->name, "platform", 8) == 0) |
45 | 50 | ||
46 | #define __arch_page_to_dma(dev, page) \ | 51 | #define __arch_dma_to_virt(dev, addr) \ |
47 | ({is_lbus_device(dev) ? (dma_addr_t)virt_to_lbus(page_address(page)) : \ | 52 | ({ \ |
48 | (dma_addr_t)__virt_to_bus(page_address(page));}) | 53 | unsigned long __virt; \ |
54 | dma_addr_t __dma = addr; \ | ||
55 | if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \ | ||
56 | __virt = __lbus_to_virt(__dma); \ | ||
57 | else \ | ||
58 | __virt = __bus_to_virt(__dma); \ | ||
59 | (void *)__virt; \ | ||
60 | }) | ||
49 | 61 | ||
50 | #define __arch_dma_to_virt(dev, addr) \ | 62 | #define __arch_virt_to_dma(dev, addr) \ |
51 | ({is_lbus_device(dev) ? lbus_to_virt(addr) : __bus_to_virt(addr);}) | 63 | ({ \ |
64 | unsigned long __virt = (unsigned long)addr; \ | ||
65 | dma_addr_t __dma; \ | ||
66 | if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \ | ||
67 | __dma = __virt_to_lbus(__virt); \ | ||
68 | else \ | ||
69 | __dma = __virt_to_bus(__virt); \ | ||
70 | __dma; \ | ||
71 | }) | ||
52 | 72 | ||
53 | #define __arch_virt_to_dma(dev, addr) \ | 73 | #define __arch_page_to_dma(dev, page) \ |
54 | ({is_lbus_device(dev) ? virt_to_lbus(addr) : __virt_to_bus(addr);}) | 74 | __arch_virt_to_dma(dev, page_address(page)) |
55 | 75 | ||
56 | #endif /* CONFIG_ARCH_IOP13XX */ | 76 | #endif /* CONFIG_ARCH_IOP13XX */ |
57 | #endif /* !ASSEMBLY */ | 77 | #endif /* !ASSEMBLY */ |