lkml.org 
[lkml]   [2022]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] riscv/efi_stub: Fix get_boot_hartid_from_fdt() return value
From
On 2/14/22 10:12, Andreas Schwab wrote:
> On Jan 28 2022, Sunil V L wrote:
>
>> diff --git a/drivers/firmware/efi/libstub/riscv-stub.c b/drivers/firmware/efi/libstub/riscv-stub.c
>> index 380e4e251399..9c460843442f 100644
>> --- a/drivers/firmware/efi/libstub/riscv-stub.c
>> +++ b/drivers/firmware/efi/libstub/riscv-stub.c
>> @@ -25,7 +25,7 @@ typedef void __noreturn (*jump_kernel_func)(unsigned int, unsigned long);
>>
>> static u32 hartid;
>>
>> -static u32 get_boot_hartid_from_fdt(void)
>> +static int get_boot_hartid_from_fdt(void)
>
> I think the function should be renamed, now that it no longer returns
> the hart ID, but initializes a static variable as a side effect. Thus
> it no longer "gets", but "sets".
>

set_boot_hartid() implies that the caller can change the boot hart ID.
As this is not a case this name obviously would be a misnomer.

Best regards

Heinrich

\
 
 \ /
  Last update: 2022-02-14 10:25    [W:0.178 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site