Jisheng Zhang c1cb08c5a1 riscv: mm: init: try best to use IS_ENABLED(CONFIG_64BIT) instead of #ifdef
[ Upstream commit 07aabe8fb6d1ac3163cc74c856521f2ee746270b ]

Try our best to replace the conditional compilation using
"#ifdef CONFIG_64BIT" by a check for "IS_ENABLED(CONFIG_64BIT)", to
simplify the code and to increase compile coverage.

Now we can also remove the __maybe_unused used in max_mapped_addr
declaration.

We also remove the BUG_ON check of mapping the last 4K bytes of the
addressable memory since this is always true for every kernel actually.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Stable-dep-of: 994af1825a2a ("riscv: fix overlap of allocated page and PTR_ERR")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:14:38 +02:00
..
2023-02-01 08:27:20 +01:00