[PATCH 5/5] powerpc: make __ffs return unsigned long

2014-09-17 Thread Anton Blanchard
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: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/bitops.h | 2 +-
 arch/powerpc/sysdev/fsl_pci.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/bitops.h 
b/arch/powerpc/include/asm/bitops.h
index bd3bd57..c633f05 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -213,7 +213,7 @@ static __inline__ unsigned long ffz(unsigned long x)
return __ilog2(x  -x);
 }
 
-static __inline__ int __ffs(unsigned long x)
+static __inline__ unsigned long __ffs(unsigned long x)
 {
return __ilog2(x  -x);
 }
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index c507767..dae96fb 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -152,7 +152,7 @@ static int setup_one_atmu(struct ccsr_pci __iomem *pci,
flags |= 0x1000; /* enable relaxed ordering */
 
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));
 
if (index + i = 5)
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 5/5] powerpc: make __ffs return unsigned long

2014-09-17 Thread Anton Blanchard
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: Anton Blanchard an...@samba.org
Tested-by: Emil Medve emilian.me...@freescale.com
---
 arch/powerpc/include/asm/bitops.h | 2 +-
 arch/powerpc/sysdev/fsl_pci.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/bitops.h 
b/arch/powerpc/include/asm/bitops.h
index bd3bd57..c633f05 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -213,7 +213,7 @@ static __inline__ unsigned long ffz(unsigned long x)
return __ilog2(x  -x);
 }
 
-static __inline__ int __ffs(unsigned long x)
+static __inline__ unsigned long __ffs(unsigned long x)
 {
return __ilog2(x  -x);
 }
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index c507767..dae96fb 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -152,7 +152,7 @@ static int setup_one_atmu(struct ccsr_pci __iomem *pci,
flags |= 0x1000; /* enable relaxed ordering */
 
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));
 
if (index + i = 5)
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 5/5] powerpc: make __ffs return unsigned long

2014-08-05 Thread Anton Blanchard
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: Anton Blanchard an...@samba.org
---

Index: b/arch/powerpc/include/asm/bitops.h
===
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -213,7 +213,7 @@ static __inline__ unsigned long ffz(unsi
return __ilog2(x  -x);
 }
 
-static __inline__ int __ffs(unsigned long x)
+static __inline__ unsigned long __ffs(unsigned long x)
 {
return __ilog2(x  -x);
 }
Index: b/arch/powerpc/sysdev/fsl_pci.c
===
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -152,7 +152,7 @@ static int setup_one_atmu(struct ccsr_pc
flags |= 0x1000; /* enable relaxed ordering */
 
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));
 
if (index + i = 5)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev