WSL2-Linux-Kernel/arch/riscv/mm
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
..
Makefile riscv: Fix config KASAN && DEBUG_VIRTUAL 2022-03-08 19:12:42 +01:00
cacheflush.c riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte 2023-02-14 19:18:03 +01:00
context.c riscv: mm: Fix incorrect ASID argument when flushing TLB 2023-03-30 12:47:59 +02:00
extable.c
fault.c riscv, mm: Perform BPF exhandler fixup on page fault 2023-03-10 09:40:12 +01:00
hugetlbpage.c hugetlbfs: remove hugetlb_add_hstate() warning for existing hstate 2020-06-03 20:09:46 -07:00
init.c riscv: mm: fix truncation warning on RV32 2023-07-23 13:47:45 +02:00
kasan_init.c riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP 2022-03-08 19:12:42 +01:00
pageattr.c RISC-V: mm: Enable huge page support to kernel_page_present() function 2023-05-17 11:50:16 +02:00
physaddr.c riscv: Introduce structure that group all variables regarding kernel mapping 2021-07-05 18:04:00 -07:00
ptdump.c riscv: Fix PTDUMP output now BPF region moved back to module region 2021-07-06 15:21:27 -07:00
tlbflush.c riscv: mm: Fix incorrect ASID argument when flushing TLB 2023-03-30 12:47:59 +02:00