From: Rylan Dmello <mail@rylan.coffee>
To: Manish Chopra <manishc@marvell.com>,
GR-Linux-NIC-Dev@marvell.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, Joe Perches <joe@perches.com>
Subject: [PATCH v2 2/7] staging: qlge: Remove gotos from ql_set_mac_addr_reg
Date: Wed, 29 Apr 2020 21:33:04 -0400 [thread overview]
Message-ID: <a6f485e43eb55e8fdc64a7a346cb0419b55c3cb6.1588209862.git.mail@rylan.coffee> (raw)
In-Reply-To: <cover.1588209862.git.mail@rylan.coffee>
As suggested by Joe Perches, this patch removes the 'exit' label
from the ql_set_mac_addr_reg function and replaces the goto
statements with break statements.
Signed-off-by: Rylan Dmello <mail@rylan.coffee>
---
drivers/staging/qlge/qlge_main.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 29610618c7c0..f2b4a54fc4c0 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -336,22 +336,20 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
if (status)
- goto exit;
+ break;
ql_write32(qdev, MAC_ADDR_IDX,
(offset++) | (index << MAC_ADDR_IDX_SHIFT) | type |
MAC_ADDR_E);
ql_write32(qdev, MAC_ADDR_DATA, lower);
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
if (status)
- goto exit;
+ break;
ql_write32(qdev, MAC_ADDR_IDX,
(offset++) | (index << MAC_ADDR_IDX_SHIFT) | type |
MAC_ADDR_E);
ql_write32(qdev, MAC_ADDR_DATA, upper);
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
- if (status)
- goto exit;
break;
}
case MAC_ADDR_TYPE_CAM_MAC: {
@@ -361,7 +359,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
(addr[5]);
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
if (status)
- goto exit;
+ break;
ql_write32(qdev, MAC_ADDR_IDX,
(offset++) | /* offset */
(index << MAC_ADDR_IDX_SHIFT) | /* index */
@@ -369,7 +367,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
ql_write32(qdev, MAC_ADDR_DATA, lower);
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
if (status)
- goto exit;
+ break;
ql_write32(qdev, MAC_ADDR_IDX,
(offset++) | /* offset */
(index << MAC_ADDR_IDX_SHIFT) | /* index */
@@ -377,7 +375,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
ql_write32(qdev, MAC_ADDR_DATA, upper);
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
if (status)
- goto exit;
+ break;
ql_write32(qdev, MAC_ADDR_IDX,
(offset) | /* offset */
(index << MAC_ADDR_IDX_SHIFT) | /* index */
@@ -404,7 +402,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
*/
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
if (status)
- goto exit;
+ break;
ql_write32(qdev, MAC_ADDR_IDX,
offset | /* offset */
(index << MAC_ADDR_IDX_SHIFT) | /* index */
@@ -418,7 +416,6 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
"Address type %d not yet supported.\n", type);
status = -EPERM;
}
-exit:
return status;
}
--
2.26.2
next prev parent reply other threads:[~2020-04-30 1:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 1:31 [PATCH v2 0/7] staging: qlge: Checkpatch.pl indentation fixes in qlge_main.c Rylan Dmello
2020-04-30 1:32 ` [PATCH v2 1/7] staging: qlge: Fix indentation in ql_set_mac_addr_reg Rylan Dmello
2020-04-30 1:33 ` Rylan Dmello [this message]
2020-04-30 9:38 ` [PATCH v2 2/7] staging: qlge: Remove gotos from ql_set_mac_addr_reg Dan Carpenter
2020-04-30 10:03 ` Joe Perches
2020-04-30 10:08 ` Dan Carpenter
2020-04-30 1:33 ` [PATCH v2 3/7] staging: qlge: Fix indentation in ql_get_mac_addr_reg Rylan Dmello
2020-04-30 1:33 ` [PATCH v2 4/7] staging: qlge: Remove goto statements from ql_get_mac_addr_reg Rylan Dmello
2020-04-30 1:34 ` [PATCH v2 5/7] staging: qlge: Remove multi-line dereference from ql_request_irq Rylan Dmello
2020-04-30 1:34 ` [PATCH v2 6/7] staging: qlge: Fix suspect code indent warning in ql_init_device Rylan Dmello
2020-04-30 1:35 ` [PATCH v2 7/7] staging: qlge: Fix function argument alignment " Rylan Dmello
2020-04-30 1:51 ` [PATCH v2 0/7] staging: qlge: Checkpatch.pl indentation fixes in qlge_main.c Joe Perches
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=a6f485e43eb55e8fdc64a7a346cb0419b55c3cb6.1588209862.git.mail@rylan.coffee \
--to=mail@rylan.coffee \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.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
all inboxes | Powered by JetHome®