From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH v2 net-next 07/12] be2net: remove unncessary gotos
Date: Tue, 2 Sep 2014 09:56:52 +0530 [thread overview]
Message-ID: <1409632017-15655-8-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1409632017-15655-1-git-send-email-sathya.perla@emulex.com>
From: Kalesh AP <kalesh.purayil@emulex.com>
In cases where there is no extra code to handle an error, this patch replaces
gotos with a direct return statement.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_main.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 7e89e5b..cdad8bc 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4090,18 +4090,15 @@ static int lancer_fw_download(struct be_adapter *adapter,
if (!IS_ALIGNED(fw->size, sizeof(u32))) {
dev_err(dev, "FW image size should be multiple of 4\n");
- status = -EINVAL;
- goto lancer_fw_exit;
+ return -EINVAL;
}
flash_cmd.size = sizeof(struct lancer_cmd_req_write_object)
+ LANCER_FW_DOWNLOAD_CHUNK;
flash_cmd.va = dma_alloc_coherent(dev, flash_cmd.size,
&flash_cmd.dma, GFP_KERNEL);
- if (!flash_cmd.va) {
- status = -ENOMEM;
- goto lancer_fw_exit;
- }
+ if (!flash_cmd.va)
+ return -ENOMEM;
dest_image_ptr = flash_cmd.va +
sizeof(struct lancer_cmd_req_write_object);
@@ -4139,7 +4136,7 @@ static int lancer_fw_download(struct be_adapter *adapter,
dma_free_coherent(dev, flash_cmd.size, flash_cmd.va, flash_cmd.dma);
if (status) {
dev_err(dev, "Firmware load error\n");
- goto lancer_fw_exit;
+ return be_cmd_status(status);
}
dev_info(dev, "Firmware flashed successfully\n");
@@ -4151,13 +4148,12 @@ static int lancer_fw_download(struct be_adapter *adapter,
if (status) {
dev_err(dev, "Adapter busy, could not reset FW\n");
dev_err(dev, "Reboot server to activate new FW\n");
- goto lancer_fw_exit;
}
} else if (change_status != LANCER_NO_RESET_NEEDED) {
dev_info(dev, "Reboot server to activate new FW\n");
}
-lancer_fw_exit:
- return status;
+
+ return 0;
}
#define UFI_TYPE2 2
--
1.7.1
next prev parent reply other threads:[~2014-09-02 4:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 4:26 [PATCH v2 net-next 00/12] be2net: patch set Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 01/12] be2net: add a few log messages Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 02/12] be2net: shorten AMAP_GET/SET_BITS() macro calls Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 03/12] be2net: add a description for counter rx_input_fifo_overflow_drop Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 04/12] be2net: Add TX completion error statistics in ethtool Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 05/12] be2net: Add a dma_mapping_error counter " Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 06/12] be2net: fix log messages in lancer FW download path Sathya Perla
2014-09-02 4:26 ` Sathya Perla [this message]
2014-09-02 4:26 ` [PATCH v2 net-next 08/12] be2net: define BE_MAX_MTU Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 09/12] be2net: make be_cmd_get_regs() return a status Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 10/12] be2net: get rid of TX budget Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 11/12] be2net: define macro for_all_tx_queues_on_eq() Sathya Perla
2014-09-02 4:26 ` [PATCH v2 net-next 12/12] be2net: query max_tx_qs for BE3 super-nic profile from FW Sathya Perla
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=1409632017-15655-8-git-send-email-sathya.perla@emulex.com \
--to=sathya.perla@emulex.com \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).