From patchwork Sat May 19 15:53:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 136403 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2547737lji; Sat, 19 May 2018 08:57:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpdPTRGKEKNmZhxPTX2GqZwP2shxV3K18iUUv5cdDaSKG+5bkYZSVEHtui39/bBxb8QVDht X-Received: by 2002:a17:902:903:: with SMTP id 3-v6mr14095939plm.377.1526745442390; Sat, 19 May 2018 08:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526745442; cv=none; d=google.com; s=arc-20160816; b=YAkDJCxcwr6x5uAizlw7ZKyEP1qyasqWPuQCknwRQcr3qqVYHdOKKXFopvVjtt/9jM 1HexTUPB7PM/ScUhIBMFj3ZYROStYdU7cOK7b7O1B4gsB0bAFyhzGwxSqcnVJ/fYyS8S y1uLzD3k8mixrrY7z/kjh3SbwimgKVB0V3l34QduwtxlUvPMyO8P3tE9cj4YLRTLKIjY QOD9kkAxpV/lz2k3bEPVcVTF/uWjrC7VqT9SwW9O+1VyGaUUsgw2C5eqkwkwG13zbHvE czzu6uPUDUyHruGwY4yC3KA3qvtAkwK97A7ZgJ8zQ4WrSCJOLSHuMle0y9Cjl6fQPUTO A/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=aN+V9qpc3CE4GQQYvGkbNkEeTneL+gRBqyCMHYmdYZE=; b=du+BLIRJVYo+0VNqjfM6GRY6RdATsR5g2jsr76cHHVPtq1D/NkzbUINSsdBLlL+9oE 0kuF0ug+oVLFccLMLNqAeYKhUiCgbHTqSsRjJTy52Vrpv7rBlpdzuL/XKmLdkvaFJyyb 3anM7Jl1U7jNjr+X7ji+IBQ+QoAyHLOozcL+uX4/VzlLCd0ALyoOLhqd7rdovXnuURHi AZC4faqZ/GKae4zFOrSqscn50N4suhYVLHCUA5fSlQHIJvw4uuSyqqbE3L3AL3W4m0TE GY4qZOkIxIyepxwv0oJcnt1+TEDigZNkfbhMnqZoP7A7BflJ8raFJYnrhTXnT7GrnPKS irhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si10100931pfd.199.2018.05.19.08.57.22; Sat, 19 May 2018 08:57:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbeESP5U (ORCPT + 29 others); Sat, 19 May 2018 11:57:20 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7689 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752537AbeESPyn (ORCPT ); Sat, 19 May 2018 11:54:43 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 364A4B564B2FA; Sat, 19 May 2018 23:54:28 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Sat, 19 May 2018 23:54:23 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 3/9] net: hns3: cleanup of return values in hclge_init_client_instance() Date: Sat, 19 May 2018 16:53:17 +0100 Message-ID: <20180519155323.68960-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180519155323.68960-1-salil.mehta@huawei.com> References: <20180519155323.68960-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Removes the goto and directly returns in case of errors as part of the cleanup. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 46435c8..46e030c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5297,7 +5297,7 @@ static int hclge_init_client_instance(struct hnae3_client *client, vport->nic.client = client; ret = client->ops->init_instance(&vport->nic); if (ret) - goto err; + return ret; if (hdev->roce_client && hnae3_dev_roce_supported(hdev)) { @@ -5305,11 +5305,11 @@ static int hclge_init_client_instance(struct hnae3_client *client, ret = hclge_init_roce_base_info(vport); if (ret) - goto err; + return ret; ret = rc->ops->init_instance(&vport->roce); if (ret) - goto err; + return ret; } break; @@ -5319,7 +5319,7 @@ static int hclge_init_client_instance(struct hnae3_client *client, ret = client->ops->init_instance(&vport->nic); if (ret) - goto err; + return ret; break; case HNAE3_CLIENT_ROCE: @@ -5331,18 +5331,16 @@ static int hclge_init_client_instance(struct hnae3_client *client, if (hdev->roce_client && hdev->nic_client) { ret = hclge_init_roce_base_info(vport); if (ret) - goto err; + return ret; ret = client->ops->init_instance(&vport->roce); if (ret) - goto err; + return ret; } } } return 0; -err: - return ret; } static void hclge_uninit_client_instance(struct hnae3_client *client,