linux-stable/arch/riscv
Jisheng Zhang 5be91e9f28 riscv: mm: fix truncation warning on RV32
[ Upstream commit b690e266da ]

lkp reports below sparse warning when building for RV32:
arch/riscv/mm/init.c:1204:48: sparse: warning: cast truncates bits from
constant value (100000000 becomes 0)

IMO, the reason we didn't see this truncates bug in real world is "0"
means MEMBLOCK_ALLOC_ACCESSIBLE in memblock and there's no RV32 HW
with more than 4GB memory.

Fix it anyway to make sparse happy.

Fixes: decf89f86e ("riscv: try to allocate crashkern region from 32bit addressible memory")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306080034.SLiCiOMn-lkp@intel.com/
Link: https://lore.kernel.org/r/20230709171036.1906-1-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-23 13:53:48 +02:00
..
boot RISC-V Patches for the 6.4 Merge Window, Part 1 2023-04-28 16:55:39 -07:00
configs Remove orphaned CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT 2023-03-27 13:12:09 +02:00
errata riscv: Fix relocatable kernels with early alternatives using -fno-pie 2023-05-31 07:07:07 -07:00
include riscv: Fix kfence now that the linear mapping can be backed by PUD/P4D/PGD 2023-06-07 07:13:53 -07:00
kernel risc-v: Fix order of IPI enablement vs RCU startup 2023-07-19 16:36:49 +02:00
kvm RISC-V Patches for the 6.4 Merge Window, Part 2 2023-05-05 12:23:33 -07:00
lib riscv: Allow to downgrade paging mode from the command line 2023-04-26 07:30:52 -07:00
mm riscv: mm: fix truncation warning on RV32 2023-07-23 13:53:48 +02:00
net riscv, bpf: Fix inconsistent JIT image generation 2023-07-23 13:53:46 +02:00
purgatory riscv/purgatory: remove PGO flags 2023-06-12 11:31:51 -07:00
tools riscv: Check relocations at compile time 2023-04-19 07:46:32 -07:00
Kbuild
Kconfig riscv/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
Kconfig.debug
Kconfig.errata Merge patch series "RISC-V: Fixes for riscv_has_extension[un]likely()'s alternative dependency" 2023-03-29 12:26:38 -07:00
Kconfig.socs RISC-V Patches for the 6.3 Merge Window, Part 1 2023-02-25 11:14:08 -08:00
Makefile RISC-V Patches for the 6.4 Merge Window, Part 1 2023-04-28 16:55:39 -07:00
Makefile.postlink riscv: Use --emit-relocs in order to move .rela.dyn in init 2023-04-19 07:46:33 -07:00