Re: [PATCH net-next v6 07/11] net/smc: register loopback-ism into SMC-D device list

From: Alexandra Winter
Date: Thu Apr 25 2024 - 09:29:55 EST




On 25.04.24 13:29, Wenjia Zhang wrote:
>> +    if (!smcd->pnetid[0]) {
>> +        fentry = list_first_entry_or_null(&smcd_dev_list.list,
>> +                          struct smcd_dev, list);
>> +        if (fentry && smc_ism_is_loopback(fentry))
>> +            list_add(&smcd->list, &fentry->list);
>> +        else
>> +            list_add(&smcd->list, &smcd_dev_list.list);
>> +    } else {
>>           list_add_tail(&smcd->list, &smcd_dev_list.list);
>> -    else
>> -        list_add(&smcd->list, &smcd_dev_list.list);
>> +    }
>
> Nit: here the pair of curly brackets are unnecessary.

Actually
https://www.kernel.org/doc/html/latest/process/coding-style.html#codingstyle
tells you to use those braces.