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  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, 19 Jan 2010 10:54:29 -0600 (CST)
From:	Christoph Lameter <cl@...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>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH 01/37] x86: move range related operation to one file


On Fri, 15 Jan 2010, Yinghai Lu wrote:

<need more text here describing f.e. how you changed the API and merged
some functions doing similar work>

> Signed-off-by: Yinghai Lu <yinghai@...nel.org>

> -
> -static int __init cmp_range(const void *x1, const void *x2)
> -{
> -	const struct res_range *r1 = x1;
> -	const struct res_range *r2 = x2;
> -	long start1, start2;
> -
> -	start1 = r1->start;
> -	start2 = r2->start;
> -
> -	return start1 - start2;
> -}


Function is passed to sort() should not be used directly. Maybe add
comments.

> -	static struct res_range range_new[RANGE_NUM];
> +	static struct range range_new[RANGE_NUM];

Renaming res_range -> range. Good but explain.

> -	nr_range = add_range_with_merge(range, nr_range, 0,
> +	nr_range = add_range_with_merge(range, RANGE_NUM, nr_range, 0,
>  					(1ULL<<(20 - PAGE_SHIFT)) - 1);

add_range_with_merge semantics changed. Explain.

>  		update_res(info, start, end, IORESOURCE_IO, 1);
> -		update_range(range, start, end);
> +		subtract_range(range, RANGE_NUM, start, end);

Two functions merged?

> +void subtract_range(struct range *range, int az, u64 start, u64 end)

Subtract range can now do what update_range did? How so?

Looks quite good. Just add some ornaments describing things to make it
clearer.

--
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