[PATCH 2/6] powerpc: numa: Fix overshift on PPC32

From: Jonathan NeuschÃfer
Date: Tue Feb 20 2018 - 11:18:52 EST


When read_n_cells is compiled for PPC32, "result << 32" causes an
overshift, which GCC doesn't like. Fix this by using u64 instead of
unsigned long.

Signed-off-by: Jonathan NeuschÃfer <j.neuschaefer@xxxxxxx>
---
arch/powerpc/mm/numa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index edd8d0bc9364..0570bc2a0b13 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -357,9 +357,9 @@ static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells)
of_node_put(memory);
}

-static unsigned long read_n_cells(int n, const __be32 **buf)
+static u64 read_n_cells(int n, const __be32 **buf)
{
- unsigned long result = 0;
+ u64 result = 0;

while (n--) {
result = (result << 32) | of_read_number(*buf, 1);
--
2.16.1