Re: [PATCH 1/4] powerpc/xive: remove dead NULL check after GFP_NOFAIL allocation

Gou Hao <[email protected]>
Newsgroups org.ozlabs.lists.linuxppc-dev,org.kvack.linux-mm
Message-ID <2B4E356BD3ECC2A3+5e1ad5e2-b34a-4ccd-a11f-60957a20e7b5@uniontech.com>
On 7/23/26 17:37, Mukesh Kumar Chaurasiya wrote:
> On Thu, Jul 23, 2026 at 04:18:10PM +0800, Gou Hao wrote:
>> kzalloc_objs with the __GFP_NOFAIL flag will never return NULL, so the
>> subsequent NULL check is unreachable dead code. Remove it.
>>
>> Signed-off-by: Gou Hao<[email protected]>
>> ---
>>   arch/powerpc/sysdev/xive/common.c | 3 ---
>>   1 file changed, 3 deletions(-)
>>
>> diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
>> index dadd1f46ec93..79d7854259cb 100644
>> --- a/arch/powerpc/sysdev/xive/common.c
>> +++ b/arch/powerpc/sysdev/xive/common.c
>> @@ -1134,9 +1134,6 @@ static int __init xive_init_ipis(void)
>>   
>>   	xive_ipis = kzalloc_objs(*xive_ipis, nr_node_ids,
>>   				 GFP_KERNEL | __GFP_NOFAIL);
>> -	if (!xive_ipis)
>> -		goto out_free_domain;
> This will be an unused label after this.
>
> Regards,
> Mukesh

Thank you for the review. I will fix it in the next version.


thanks,

Gou Hao

>> -
>>   	for_each_node(node) {
>>   		struct xive_ipi_desc *xid = &xive_ipis[node];
>>   		struct xive_ipi_alloc_info info = { node };
>> -- 
>> 2.20.1
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.