[Top] [All Lists]

weirdness in bootmem_init(), arch/mips64/kernel/setup.c

To: Linux-MIPS <>
Subject: weirdness in bootmem_init(), arch/mips64/kernel/setup.c
From: Andrew Clausen <>
Date: Tue, 18 Feb 2003 17:54:27 +1100
Original-recipient: rfc822;
User-agent: Mutt/1.4i
Hi all,

This code isn't really relevant to what I'm working on (it isn't compiled
in to kernels for the ip27), but I just noticed it, and it looks broken:

        /* Find the highest page frame number we have available.  */
        max_pfn = 0;
        for (i = 0; i < boot_mem_map.nr_map; i++) {
                unsigned long start, end;

                if ([i].type != BOOT_MEM_RAM)

*****           start = PFN_UP([i].addr);
*****           end = PFN_DOWN([i].addr

*****           if (start >= end)
                if (end > max_pfn)
                        max_pfn = end;

That test looks like it will always succeed... and it looks like the
author wanted it to be a sanity check.

Why all this business with PFN_UP and PFN_DOWN?  (They are bit
shifts... PFN_UP shifts left, PFN_DOWN shifts right)


<Prev in Thread] Current Thread [Next in Thread>