Re: [PATCH net 2/2] net/smc: align the connect behaviour with TCP

From: Guangguan Wang
Date: Tue May 10 2022 - 09:03:31 EST




On 2022/5/10 19:05, Paolo Abeni wrote:
>> } else {
>> rc = __smc_connect(smc);
>> - if (rc < 0)
>> + if (rc < 0) {
>> goto out;
>> - else
>> + } else {
>> rc = 0; /* success cases including fallback */
>> + sock->state = SS_CONNECTED;
>
> 'else' is not needed here, you can keep the above 2 statements dropping
> an indentation level.
>
>> + }
>> }
>>
>
> You can avoid a little code duplication adding here the following:
>
> connected:
> sock->state = SS_CONNECTED;
>
> and using the new label where appropriate.
>

Got it, I will modify it in the next version.
Thanks.