powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

Michael Ellerman patch-notifications at ellerman.id.au
Fri Mar 22 23:21:40 AEDT 2019

On Sun, 2019-03-17 at 01:17:56 UTC, Ben Hutchings wrote:
> MAX_PHYSMEM_BITS only needs to be defined if CONFIG_SPARSEMEM is
> enabled, and that was the case before commit 4ffe713b7587
> ("powerpc/mm: Increase the max addressable memory to 2PB").
> On 32-bit systems, where CONFIG_SPARSEMEM is not enabled, we now
> define it as 46.  That is larger than the real number of physical
> address bits, and breaks calculations in zsmalloc:
>     mm/zsmalloc.c:130:49: warning: right shift count is negative [-Wshift-count-negative]
>                                                      ^~
>     ...
>     mm/zsmalloc.c:253:21: error: variably modified 'size_class' at file scope
>       struct size_class *size_class[ZS_SIZE_CLASSES];
>                          ^~~~~~~~~~
> Fixes: 4ffe713b7587 ("powerpc/mm: Increase the max addressable memory to 2PB")
> Cc: stable at vger.kernel.org
> Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

Applied to powerpc fixes, thanks.



More information about the Linuxppc-dev mailing list