Re: [PATCH 01/37] x86: move range related operation to one file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/19/2010 08:54 AM, Christoph Lameter wrote:
> 
> 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@xxxxxxxxxx>
> 
>> -
>> -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?

update_range was introduced at first. and actually it did sth like subtract range.

and subtract range is more accurate.

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

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux