From: Mel Gorman The 64-bit resource change ended up causing us to do a 64-bit divide and ppc32 won't link (missing __udivdi3). The following patch has been successfully boot tested on the same machine with 64 bit resource_size_t. Because the mask is assumed to be a power-of-two - 1, I added a comment and a BUG_ON() to be sure. Signed-off-by: Mel Gorman Cc: Segher Boessenkool Cc: Greg KH Cc: Vivek Goyal Signed-off-by: Andrew Morton --- arch/powerpc/kernel/pci_32.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff -puN arch/powerpc/kernel/pci_32.c~64-bit-resources-arch-powerpc-changes-update arch/powerpc/kernel/pci_32.c --- devel/arch/powerpc/kernel/pci_32.c~64-bit-resources-arch-powerpc-changes-update 2006-05-29 15:52:59.000000000 -0700 +++ devel-akpm/arch/powerpc/kernel/pci_32.c 2006-05-29 15:54:45.000000000 -0700 @@ -1114,8 +1114,16 @@ check_for_io_childs(struct pci_bus *bus, int i; int rc = 0; -#define push_end(res, size) do { unsigned long __sz = (size) ; \ - res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \ + /* + * Assuming mask is a power of two - 1, push_end + * moves res->end to the end of the next + * mask-aligned boundary. + * e.g. res->end of 0x1fff moves to 0x2fff + */ +#define push_end(res, mask) do { \ + BUG_ON(((mask+1) & mask) != 0); \ + res->end = -(-res->end & ~(unsigned long)mask); \ + res->end += mask; \ } while (0) list_for_each_entry(dev, &bus->devices, bus_list) { _