sparc64: simplify reduce_memory() function
authorMike Rapoport <rppt@linux.ibm.com>
Tue, 12 Feb 2019 09:32:36 +0000 (11:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 May 2019 21:26:17 +0000 (14:26 -0700)
commitf4d9a23d3dad0252f375901bf4ff6523a2c97241
tree432421c225e82793c7318b9773b73495893be1d6
parentbc0025b6107c011e8f9411a275d8442a56bd573a
sparc64: simplify reduce_memory() function

The reduce_memory() function clampls the available memory to a limit
defined by the "mem=" command line parameter. It takes into account the
amount of already reserved memory and excludes it from the limit
calculations.

Rather than traverse memblocks and remove them by hand, use
memblock_reserved_size() to account the reserved memory and
memblock_enforce_memory_limit() to clamp the available memory.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/init_64.c