Balbir Singh <bsinghar...@gmail.com> writes:
> On 12/10/16 17:57, Nicholas Piggin wrote:
>> diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
>> index 79da0641..bc9ceac 100644
>> --- a/arch/powerpc/kernel/head_64.S
>> +++ b/arch/powerpc/kernel/head_64.S
>> @@ -111,8 +111,12 @@ __secondary_hold_acknowledge:
>>      .globl  __run_at_load
>>  __run_at_load:
>>  DEFINE_FIXED_SYMBOL(__run_at_load)
>> +#ifdef CONFIG_RELOCATABLE_TEST
>> +    .long   0x1             /* Test relocation, do not relocate to 0 */
>> +#else
>>      .long   0x72756e30      /* "run0" -- relocate to 0 by default */
>>  #endif
>> +#endif
>
> Could we do something like
>
> config RELOCATION_VALUE
>       default 0x72756e30
>       default 1  if CONFIG_RELOCTABLE_TEST

I'm not a fan of using kconfig logic when plain #defines would achieve
the same result, eg:

#ifdef CONFIG_RELOCATABLE_TEST
#define RUN_AT_LOAD_DEFAULT 1           /* Test relocation, do not relocate to 
0 */
#else
#define RUN_AT_LOAD_DEFAULT 0x72756e30  /* "run0" -- relocate to 0 by default */
#endif

        .globl  __run_at_load
__run_at_load:
DEFINE_FIXED_SYMBOL(__run_at_load)
        .long   RUN_AT_LOAD_DEFAULT


Which is probably nicer to look at than Nick's version, but not by a
huge margin. I'd merge either.

cheers

Reply via email to