From 18b1a2298746c34e1133768a7da2868f00e8ca6e Mon Sep 17 00:00:00 2001 From: Ilya Yanok Date: Mon, 1 Sep 2008 17:53:22 +1000 Subject: [PATCH] --- yaml --- r: 114539 b: refs/heads/master c: cc2e113b4bbd415d53d8bb87a446cde6b7ce8acc h: refs/heads/master i: 114537: b6330a62816f4f43088e73dac8d235f6307fb34d 114535: 90cf36c245ee2abeb76aa30b222e2cbc2f698456 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/sysdev/ppc4xx_pci.c | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4cd4a6e7a949..b90eff38ca94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 38d56f1677130004497835a776feb84f068ce22a +refs/heads/master: cc2e113b4bbd415d53d8bb87a446cde6b7ce8acc diff --git a/trunk/arch/powerpc/sysdev/ppc4xx_pci.c b/trunk/arch/powerpc/sysdev/ppc4xx_pci.c index d5c345dbb89d..5da8a44ea2f6 100644 --- a/trunk/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/trunk/arch/powerpc/sysdev/ppc4xx_pci.c @@ -30,14 +30,12 @@ #include #include #include +#include #include "ppc4xx_pci.h" static int dma_offset_set; -/* Move that to a useable header */ -extern unsigned long total_memory; - #define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) #define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) @@ -105,7 +103,8 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose, /* Default */ res->start = 0; - res->end = size = 0x80000000; + size = 0x80000000; + res->end = size - 1; res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; /* Get dma-ranges property */ @@ -167,13 +166,13 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose, */ if (size < total_memory) { printk(KERN_ERR "%s: dma-ranges too small " - "(size=%llx total_memory=%lx)\n", - hose->dn->full_name, size, total_memory); + "(size=%llx total_memory=%llx)\n", + hose->dn->full_name, size, (u64)total_memory); return -ENXIO; } /* Check we are a power of 2 size and that base is a multiple of size*/ - if (!is_power_of_2(size) || + if ((size & (size - 1)) != 0 || (res->start & (size - 1)) != 0) { printk(KERN_ERR "%s: dma-ranges unaligned\n", hose->dn->full_name);