MIPS: Remove a warning when PHYS_OFFSET is 0x0
authorMathieu Malaterre <malat@debian.org>
Tue, 2 Jan 2018 18:53:15 +0000 (19:53 +0100)
committerJames Hogan <jhogan@kernel.org>
Mon, 19 Feb 2018 10:55:38 +0000 (10:55 +0000)
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>
arch/mips/kernel/setup.c

index 28be8f2..563188a 100644 (file)
@@ -454,7 +454,7 @@ static void __init bootmem_init(void)
                pr_info("Wasting %lu bytes for tracking %lu unused pages\n",
                        (min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page),
                        min_low_pfn - ARCH_PFN_OFFSET);
-       } else if (min_low_pfn < ARCH_PFN_OFFSET) {
+       } else if (ARCH_PFN_OFFSET - min_low_pfn > 0UL) {
                pr_info("%lu free pages won't be used\n",
                        ARCH_PFN_OFFSET - min_low_pfn);
        }