arm64: hugetlb: Cleanup setup_hugepagesz
authorSteve Capper <steve.capper@arm.com>
Tue, 22 Aug 2017 10:42:49 +0000 (11:42 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 22 Aug 2017 16:47:12 +0000 (17:47 +0100)
commit828f193dd62a40ade5ea8b24cb8b0a22c30df673
tree46cab021067ad81bbfb6ea7547262ce8fa004d76
parent5cd028b9d90403bf24c8bf7915ed61c7a9bfce6c
arm64: hugetlb: Cleanup setup_hugepagesz

Replace a lot of if statements with switch and case labels to make it
much clearer which huge page sizes are supported.

Also, we prevent PUD_SIZE from being used on systems not running with
4KB PAGE_SIZE. Before if one supplied PUD_SIZE in these circumstances,
then unusuable huge page sizes would be in use.

Fixes: 084bd29810a5 ("ARM64: mm: HugeTLB support.")
Cc: David Woods <dwoods@mellanox.com>
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/hugetlbpage.c