]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools: selftests: riscv: Fix compile warnings in mm tests
authorChristoph Müllner <christoph.muellner@vrull.eu>
Thu, 23 Nov 2023 18:58:21 +0000 (19:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:48 +0000 (13:34 +0100)
commit12d43aec0e75731dd800e5cbfa0714bf0b493443
treec6913b253d574216cdd3795848764f0884911335
parenta613c646660aa3083330fb0d57d1b1bf5c63b21e
tools: selftests: riscv: Fix compile warnings in mm tests

[ Upstream commit 12c16919652b5873f524c8b361336ecfa5ce5e6b ]

When building the mm tests with a riscv32 compiler, we see a range
of shift-count-overflow errors from shifting 1UL by more than 32 bits
in do_mmaps(). Since, the relevant code is only called from code that
is gated by `__riscv_xlen == 64`, we can just apply the same gating
to do_mmaps().

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20231123185821.2272504-6-christoph.muellner@vrull.eu
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/riscv/mm/mmap_test.h