Linux MIPS Architecture development
 help / color / mirror / Atom feed
* weirdness in bootmem_init(), arch/mips64/kernel/setup.c
@ 2003-02-18  6:54 Andrew Clausen
  2003-02-18 10:27 ` Juan Quintela
  2003-02-18 10:42 ` Ralf Baechle
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Clausen @ 2003-02-18  6:54 UTC (permalink / raw)
  To: Linux-MIPS

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 (boot_mem_map.map[i].type != BOOT_MEM_RAM)
                        continue;

*****           start = PFN_UP(boot_mem_map.map[i].addr);
*****           end = PFN_DOWN(boot_mem_map.map[i].addr
                      + boot_mem_map.map[i].size);

*****           if (start >= end)
                        continue;
                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)

Cheers,
Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-18 22:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-18  6:54 weirdness in bootmem_init(), arch/mips64/kernel/setup.c Andrew Clausen
2003-02-18 10:27 ` Juan Quintela
2003-02-18 10:33   ` Ralf Baechle
2003-02-18 10:42 ` Ralf Baechle
2003-02-18 22:29   ` Andrew Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox