linux-stable/arch/riscv
Jisheng Zhang 8a128e601f 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:47:45 +02:00
..
boot riscv: dts: sifive: fu740: fix size of pcie 32bit memory 2023-01-24 07:22:46 +01:00
configs RISC-V: defconfigs: Set CONFIG_FB=y, for FB console 2022-07-12 16:34:54 +02:00
errata riscv: skip errata_cip_453.o if CONFIG_ERRATA_SIFIVE_CIP_453 is disabled 2021-06-01 21:16:41 -07:00
include riscv: Move early dtb mapping into the fixmap region 2023-05-01 08:23:24 +09:00
kernel riscv: uprobes: Restore thread.bad_cause 2023-07-23 13:47:13 +02:00
lib riscv: lib: uaccess: fix CSR_STATUS SR_SUM bit 2022-08-31 17:16:36 +02:00
mm riscv: mm: fix truncation warning on RV32 2023-07-23 13:47:45 +02:00
net riscv, bpf: Fix inconsistent JIT image generation 2023-07-23 13:47:44 +02:00
Kbuild riscv: Allow device trees to be built into the kernel 2020-05-18 11:38:05 -07:00
Kconfig riscv: fix kprobe __user string arg print fault issue 2023-06-14 11:13:09 +02:00
Kconfig.debug
Kconfig.erratas riscv: alternative only works on !XIP_KERNEL 2022-03-16 14:23:42 +01:00
Kconfig.socs riscv: alternative only works on !XIP_KERNEL 2022-03-16 14:23:42 +01:00
Makefile riscv: Handle zicsr/zifencei issues between clang and binutils 2023-03-30 12:47:59 +02:00