Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6103875iob; Tue, 10 May 2022 10:22:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDiKs7ZzYLmVqKuSMrhKw5x5Z5JZPzXkv7/7KoWpzz66MsoCIM0gLCLb99Wv5TdPp9vom2 X-Received: by 2002:a65:6a56:0:b0:3aa:49b8:ee77 with SMTP id o22-20020a656a56000000b003aa49b8ee77mr17726595pgu.19.1652203361194; Tue, 10 May 2022 10:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652203361; cv=none; d=google.com; s=arc-20160816; b=pNDu0d7cQ/tPDyStggy6A6v2IAS8+vPAv6u6HHKL4BpuSjAIE1HuC77BA6TG1zSlxt 4tH+0Dd2PNoRI7dygzudNbATDiyqo4rX/XTJ1O7pSErjbWQBeiXQdrGsePqDOH27HlBS 03jVOKwD+Y/efZ19I4bZIlofQs1WbF9Gm8G2MNUskPD8hLLBARa2kUEgol6i1wCNJdf9 Z4bLnrNqMMHSNVuXLxP7e68UgmvIvJRGtjq0wOBLNx0kxoyGOMujtG1FiNKPU2olzNla /NrjVIpOLBRr9CG9QX/VFdvCavqmUbP1THKlwg0aOpG8bmNlRSeLVdkWP0S4mFDfr0lD vySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=H6STRqWrP3oRu6iXWQFq9gkL6DqzhI5bivSZzuNM+2g=; b=p4RP6m1IvUPMEJv2skJWhNFSs71UtqR28QdSm1COj2MpUY2av//e++t5DqtDPlrqRW DPhqfs/RpT1mI+skFCvufRtPRUkMx60d5VzomPSzmpNDAL2SBsPIc6uxvtmmhGq8Lr5Y Z9UIKLIv0/f+xVSHFg4Q2KVwobzYdI1O4p+IMAaayH4FnZGgf7CgBmwAb6WoV1xdjYIx JdqpFVkNwIrhgOPHmZQYQncfCc6i39NJ0nC3uk7ouXufzg3Ky1kmA8QweO0gwN4ttNie nfalxBM3G+BWJ4fZ03f7Gx1WdNILH4eAmOA9TR/w9siOdJhJtaHOBajW6mJI7DGkIipY oZZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm18-20020a656e92000000b003c620dacf86si18106538pgb.818.2022.05.10.10.22.25; Tue, 10 May 2022 10:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242191AbiEJNHZ (ORCPT + 99 others); Tue, 10 May 2022 09:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242223AbiEJNHT (ORCPT ); Tue, 10 May 2022 09:07:19 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BD74261971; Tue, 10 May 2022 06:03:20 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=guangguan.wang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VCrRGve_1652187797; Received: from 30.43.104.207(mailfrom:guangguan.wang@linux.alibaba.com fp:SMTPD_---0VCrRGve_1652187797) by smtp.aliyun-inc.com(127.0.0.1); Tue, 10 May 2022 21:03:17 +0800 Message-ID: Date: Tue, 10 May 2022 21:03:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH net 2/2] net/smc: align the connect behaviour with TCP Content-Language: en-US To: Paolo Abeni Cc: kgraul@linux.ibm.com, davem@davemloft.net, kuba@kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220509115837.94911-1-guangguan.wang@linux.alibaba.com> <20220509115837.94911-3-guangguan.wang@linux.alibaba.com> From: Guangguan Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.