On Tue, 09 Feb 2010 11:32:32 -0800 Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > /* > + * Find a free area with specified alignment in a specific range. > + */ > +u64 __init find_e820_area(u64 start, u64 end, u64 size, u64 align) > +{ > + int i; > + > + for (i = 0; i < e820.nr_map; i++) { > + struct e820entry *ei = &e820.map[i]; > + u64 addr; > + u64 ei_start, ei_last; > + > + if (ei->type != E820_RAM) > + continue; > + > + ei_last = ei->addr + ei->size; > + ei_start = ei->addr; > + addr = find_early_area(ei_start, ei_last, start, end, > + size, align); > + > + if (addr == -1ULL) > + continue; > + > + return addr; Small simplification: if (addr != -1) return addr; > + } > + return -1ULL; > +} > + > +/* > + * Find next free range after *start > + */ > +u64 __init find_e820_area_size(u64 start, u64 *sizep, u64 align) > +{ > + int i; > + > + for (i = 0; i < e820.nr_map; i++) { > + struct e820entry *ei = &e820.map[i]; > + u64 addr; > + u64 ei_start, ei_last; > + > + if (ei->type != E820_RAM) > + continue; > + > + ei_last = ei->addr + ei->size; > + ei_start = ei->addr; > + addr = find_early_area_size(ei_start, ei_last, start, > + sizep, align); > + > + if (addr == -1ULL) > + continue; > + > + return addr; Ditto. > + } > + > + return -1ULL; > +} -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html