Subject: Re: [RFC 6/8] powerpc/book3s64/slb: Make preload_add return type as void

From: Ritesh Harjani (IBM) <[email-masked]>
Date: Sat, 30 Aug 2025 12:57:20 +0530

Christophe Leroy <[email-masked]> writes:

> Le 30/08/2025 à 05:51, Ritesh Harjani (IBM) a écrit :
>> We dropped preload_new_slb_context() in the previous patch. That means
>
> slb_setup_new_exec() was also checking preload_add() returned value but 
> is also gone.
>

Right. Will add that.

>> we don't really need preload_add() return type anymore. So let's make
>> it's return type to void.
>
> s/it's/its
>

Sure.

>> 
>> Cc: Madhavan Srinivasan <[email-masked]>
>> Cc: Michael Ellerman <[email-masked]>
>> Cc: Nicholas Piggin <[email-masked]>
>> Cc: Christophe Leroy <[email-masked]>
>> Cc: Paul Mackerras <[email-masked]>
>> Cc: "Aneesh Kumar K.V" <[email-masked]>
>> Cc: Donet Tom <[email-masked]>
>> Cc: [email-masked]
>> Signed-off-by: Ritesh Harjani (IBM) <[email-masked]>
>> ---
>>   arch/powerpc/mm/book3s64/slb.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/arch/powerpc/mm/book3s64/slb.c b/arch/powerpc/mm/book3s64/slb.c
>> index 7e053c561a09..780792b9a1e5 100644
>> --- a/arch/powerpc/mm/book3s64/slb.c
>> +++ b/arch/powerpc/mm/book3s64/slb.c
>> @@ -294,7 +294,7 @@ static bool preload_hit(struct thread_info *ti, unsigned long esid)
>>   	return false;
>>   }
>> 
>> -static bool preload_add(struct thread_info *ti, unsigned long ea)
>> +static void preload_add(struct thread_info *ti, unsigned long ea)
>>   {
>>   	unsigned char idx;
>>   	unsigned long esid;
>> @@ -308,7 +308,7 @@ static bool preload_add(struct thread_info *ti, unsigned long ea)
>>   	esid = ea >> SID_SHIFT;
>> 
>>   	if (preload_hit(ti, esid))
>> -		return false;
>> +		return;
>> 
>>   	idx = (ti->slb_preload_tail + ti->slb_preload_nr) % SLB_PRELOAD_NR;
>>   	ti->slb_preload_esid[idx] = esid;
>> @@ -317,7 +317,7 @@ static bool preload_add(struct thread_info *ti, unsigned long ea)
>>   	else
>>   		ti->slb_preload_nr++;
>> 
>> -	return true;
>> +	return;
>
> You don't need a valueless return at the end of a function
>

Right make sense. I will fix these in the next revision. 
Thanks for the review!

-ritesh