Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Remove a warning when PHYS_OFFSET is 0x0

Rewrite the comparison in `else if` statement, case where `min_low_pfn >
ARCH_PFN_OFFSET` has already been checked in the first `if` statement:

if (min_low_pfn > ARCH_PFN_OFFSET) {

Fix non-fatal warning during compilation using W=1:

arch/mips/kernel/setup.c: In function ‘bootmem_init’:
arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
} else if (min_low_pfn < ARCH_PFN_OFFSET) {
^

Signed-off-by: Mathieu Malaterre <malat@debian.org>
Reviewed-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18176/
Signed-off-by: James Hogan <jhogan@kernel.org>

authored by

Mathieu Malaterre and committed by
James Hogan
ab3d8441 427aeea0

+1 -1
+1 -1
arch/mips/kernel/setup.c
··· 454 454 pr_info("Wasting %lu bytes for tracking %lu unused pages\n", 455 455 (min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page), 456 456 min_low_pfn - ARCH_PFN_OFFSET); 457 - } else if (min_low_pfn < ARCH_PFN_OFFSET) { 457 + } else if (ARCH_PFN_OFFSET - min_low_pfn > 0UL) { 458 458 pr_info("%lu free pages won't be used\n", 459 459 ARCH_PFN_OFFSET - min_low_pfn); 460 460 }