[PATCH 2/6] ARM: keystone2: move update of the phys-to-virt constants into generic code

Grygorii.Strashko@linaro.org grygorii.strashko at linaro.org
Thu Apr 9 09:15:23 PDT 2015


On 04/09/2015 06:49 PM, Russell King - ARM Linux wrote:
> On Thu, Apr 09, 2015 at 05:51:14PM +0300, Grygorii.Strashko at linaro.org wrote:
>> @@ -1401,14 +1401,15 @@ void __init early_paging_init(const struct machine_desc *mdesc)
>>   	pgtables_remap *lpae_pgtables_remap;
>>   	unsigned long pa_pgd;
>>   	unsigned int cr;
>> -	long long offset;
>> +	phys_addr_t new_phys_offset;
>> +	phys_addr_t old_phys_offset = PHYS_OFFSET;
>>   	void *boot_data;
>>
>>   	if (!mdesc->pv_fixup)
>>   		return;
>>
>> -	offset = mdesc->pv_fixup();
>> -	if (offset == 0)
>> +	new_phys_offset = mdesc->pv_fixup();
>> +	if (new_phys_offset == 0)
>
> "0" is a special magic value here.  The advantage of the delta approach
> is that "0" is obviously equivalent to "no change".
>

can "-1"  be used?



-- 
regards,
-grygorii



More information about the linux-arm-kernel mailing list