[PATCH] arm64: Force SPARSEMEM_VMEMMAP as the only memory management model

Anshuman Khandual anshuman.khandual at arm.com
Thu Apr 22 04:04:10 BST 2021


On 4/21/21 6:32 PM, Catalin Marinas wrote:
> On Wed, Apr 21, 2021 at 10:18:56AM +0530, Anshuman Khandual wrote:
>> On 4/20/21 3:05 PM, Catalin Marinas wrote:
>>> diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
>>> index b943879c1c24..15018dc59554 100644
>>> --- a/arch/arm64/include/asm/memory.h
>>> +++ b/arch/arm64/include/asm/memory.h
>>> @@ -329,7 +329,7 @@ static inline void *phys_to_virt(phys_addr_t x)
>>>   */
>>>  #define ARCH_PFN_OFFSET		((unsigned long)PHYS_PFN_OFFSET)
>>>  
>>> -#if !defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_DEBUG_VIRTUAL)
>>> +#if defined(CONFIG_DEBUG_VIRTUAL)
>>
>> A small nit. Should this be #ifdef CONFIG_DEBUG_VIRTUAL instead ?
> 
> Yeah, for consistency I changed it to #ifdef.
> 
>> This is
>> an user selectable config and the conditional check here does not have an
>> #elseif part either. But then there are similar such instances else where
>> on arm64 platform as well.
> 
> I'm not sure I get it. What would an #elseif need to check? We already
> have an #else block for this #ifdef.

IIUC #elif always requires a defined() construct. In such cases #if defined()
might be preferable, in order to match the subsequent #elif. The point being,
in this particular case there is no #elif which would have probably justified
a preceding #if defined() construct though #ifdef is preferred.



More information about the linux-arm-kernel mailing list