Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5756340imm; Sat, 19 May 2018 08:59:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrfCmgVfJliEHofeDfp8LzjaweT6apqv30DVecwJN4RDAgHeTSCBaJaaTZOaPQjq0n6XjYj X-Received: by 2002:a17:902:bd82:: with SMTP id q2-v6mr13912919pls.77.1526745574811; Sat, 19 May 2018 08:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526745574; cv=none; d=google.com; s=arc-20160816; b=PpmsBq/k8bjhdCNb3Ky9lOqIYFtRseBLchQzdn+FfB96NHzENtpxIz+yFWreqrqaRr ctW/AhxJ5lHJu9KQcxoyjpzP8TYQSN6Tl6Q09Gm/z775mDbZ4AC/to5GGFoF5oyjg6OC oIcMtlGvFCGtQlGDLeF4/i/fzseobfjccDO1tdpV8y6UGBYpRoOBzvUcPk5uSkOejJ53 UjkSi1Mo1M0uYO2Mhr5mA/Yxj3AT6VQYpB5ybQrBSfv7AawVzrVuEVSWmhiF3NMtvuUK a+hLCCT/BsVYNhN3kBwhWV1jfCM+dlOPhTF7xP2yh24QjcE75GbR/lupYTj/E7Vh/H34 hq4g== 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 q12-v6si7446019pgn.377.2018.05.19.08.59.20; Sat, 19 May 2018 08:59:34 -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 S1752668AbeESP5U (ORCPT + 99 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 Content-Type: text/plain 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(-) 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, -- 2.7.4