lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 9 Feb 2010 12:15:28 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH 21/35] x86: move back find_e820_area to e820.c

On Tue, 09 Feb 2010 11:32:32 -0800
Yinghai Lu <yinghai@...nel.org> 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ