Commit 6e4c632c authored by Anton Blanchard's avatar Anton Blanchard Committed by Michael Ellerman

powerpc: make __ffs return unsigned long

I'm seeing a build warning in mm/nobootmem.c after removing
bootmem:

mm/nobootmem.c: In function '__free_pages_memory':
include/linux/kernel.h:713:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&_min1 == &_min2);  \
                 ^
mm/nobootmem.c:90:11: note: in expansion of macro 'min'
   order = min(MAX_ORDER - 1UL, __ffs(start));
           ^

The rest of the worlds seems to define __ffs as returning unsigned long,
so lets do that.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Tested-by: default avatarEmil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 21098b9e
...@@ -213,7 +213,7 @@ static __inline__ unsigned long ffz(unsigned long x) ...@@ -213,7 +213,7 @@ static __inline__ unsigned long ffz(unsigned long x)
return __ilog2(x & -x); return __ilog2(x & -x);
} }
static __inline__ int __ffs(unsigned long x) static __inline__ unsigned long __ffs(unsigned long x)
{ {
return __ilog2(x & -x); return __ilog2(x & -x);
} }
......
...@@ -152,7 +152,7 @@ static int setup_one_atmu(struct ccsr_pci __iomem *pci, ...@@ -152,7 +152,7 @@ static int setup_one_atmu(struct ccsr_pci __iomem *pci,
flags |= 0x10000000; /* enable relaxed ordering */ flags |= 0x10000000; /* enable relaxed ordering */
for (i = 0; size > 0; i++) { for (i = 0; size > 0; i++) {
unsigned int bits = min(ilog2(size), unsigned int bits = min_t(u32, ilog2(size),
__ffs(pci_addr | phys_addr)); __ffs(pci_addr | phys_addr));
if (index + i >= 5) if (index + i >= 5)
......
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