All of lore.kernel.org
 help / color / mirror / Atom feed
From: Salil Mehta <salil.mehta@huawei.com>
To: <davem@davemloft.net>
Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<lipeng321@huawei.com>, <mehta.salil@opnsrc.net>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, Jian Shen <shenjian15@huawei.com>
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	[thread overview]
Message-ID: <20180519155323.68960-4-salil.mehta@huawei.com> (raw)
In-Reply-To: <20180519155323.68960-1-salil.mehta@huawei.com>

From: Jian Shen <shenjian15@huawei.com>

Removes the goto and directly returns in case of errors as part of the
cleanup.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 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

  parent reply	other threads:[~2018-05-19 15:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-19 15:53 [PATCH net-next 0/9] Misc. bug fixes and cleanup for HNS3 driver Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 1/9] net: hns3: Fixes error reported by Kbuild and internal review Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 2/9] net: hns3: Fixes API to fetch ethernet header length with kernel default Salil Mehta
2018-05-19 15:53 ` Salil Mehta [this message]
2018-05-19 15:53 ` [PATCH net-next 4/9] net: hns3: Fix the missing client list node initialization Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 5/9] net: hns3: Fix for hns3 module is loaded multiple times problem Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 6/9] net: hns3: Use enums instead of magic number in hclge_is_special_opcode Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 7/9] net: hns3: Fix for netdev not running problem after calling net_stop and net_open Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 8/9] net: hns3: Fixes kernel panic issue during rmmod hns3 driver Salil Mehta
2018-05-19 15:53 ` [PATCH net-next 9/9] net: hns3: Fix for CMDQ and Misc. interrupt init order problem Salil Mehta
2018-05-20 22:56 ` [PATCH net-next 0/9] Misc. bug fixes and cleanup for HNS3 driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180519155323.68960-4-salil.mehta@huawei.com \
    --to=salil.mehta@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=mehta.salil@opnsrc.net \
    --cc=netdev@vger.kernel.org \
    --cc=shenjian15@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.