Messages in this thread | | | Date | Wed, 10 Oct 2012 09:41:45 -0400 | From | Konrad Rzeszutek Wilk <> | Subject | Re: [PATCH 2/3] x86, mm: Don't clear page table if next range is ram |
| |
On Tue, Oct 09, 2012 at 06:00:12PM -0700, Yinghai Lu wrote: > On Tue, Oct 9, 2012 at 8:46 AM, Konrad Rzeszutek Wilk <konrad@kernel.org> wrote: > >> + !e820_any_mapped(addr & PAGE_MASK, next, 0)) > > > > What is the 0 parameter for? > > any type
OK, which means that it either should have a #define for it, or at least a comment, like:
0 /* any type */
as this would make it clear at first glance what it is - without having to dive in e820_any_mapped function to determine that.
> > if type != 0, the will only check entries with same type. > > int > e820_any_mapped(u64 start, u64 end, unsigned type) > { > int i; > > for (i = 0; i < e820.nr_map; i++) { > struct e820entry *ei = &e820.map[i]; > > if (type && ei->type != type) > continue; > if (ei->addr >= end || ei->addr + ei->size <= start) > continue; > return 1; > } > return 0; > } >
| |