]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/sysdev/ppc4xx_pci.c
Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / arch / powerpc / sysdev / ppc4xx_pci.c
index 9f6f73d584d62c20ce5650cecd4dbe7e3917d865..d3e4d61030b59039759ad4d4d2eaa9318e32abe0 100644 (file)
@@ -39,13 +39,10 @@ static int dma_offset_set;
 #define U64_TO_U32_LOW(val)    ((u32)((val) & 0x00000000ffffffffULL))
 #define U64_TO_U32_HIGH(val)   ((u32)((val) >> 32))
 
-#ifdef CONFIG_RESOURCES_64BIT
-#define RES_TO_U32_LOW(val)    U64_TO_U32_LOW(val)
-#define RES_TO_U32_HIGH(val)   U64_TO_U32_HIGH(val)
-#else
-#define RES_TO_U32_LOW(val)    (val)
-#define RES_TO_U32_HIGH(val)   (0)
-#endif
+#define RES_TO_U32_LOW(val)    \
+       ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val))
+#define RES_TO_U32_HIGH(val)   \
+       ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0))
 
 static inline int ppc440spe_revA(void)
 {
@@ -144,12 +141,11 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
 
                /* Use that */
                res->start = pci_addr;
-#ifndef CONFIG_RESOURCES_64BIT
                /* Beware of 32 bits resources */
-               if ((pci_addr + size) > 0x100000000ull)
+               if (sizeof(resource_size_t) == sizeof(u32) &&
+                   (pci_addr + size) > 0x100000000ull)
                        res->end = 0xffffffff;
                else
-#endif
                        res->end = res->start + size - 1;
                break;
        }