From: SF Markus Elfring <elfring@users.sourceforge.net>
To: netdev@vger.kernel.org, linux-wimax@intel.com,
Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: [PATCH] wimax/i2400m: Use common error handling code in i2400m_wake_tx_work()
Date: Sun, 29 Oct 2017 18:06:00 +0100 [thread overview]
Message-ID: <62ad3417-8297-b763-ae49-bb8c097c2679@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 29 Oct 2017 18:00:17 +0100
Adjust jump targets so that a bit of exception handling can be better
reused at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/wimax/i2400m/netdev.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index a654687b5fa2..e3acdd295f12 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -181,8 +181,7 @@ void i2400m_wake_tx_work(struct work_struct *ws)
if (result < 0) {
dev_err(dev, "WAKE&TX: device didn't get out of idle: "
"%d - resetting\n", result);
- i2400m_reset(i2400m, I2400M_RT_BUS);
- goto error;
+ goto reset_i2400m;
}
result = wait_event_timeout(i2400m->state_wq,
i2400m->state != I2400M_SS_IDLE,
@@ -192,12 +191,11 @@ void i2400m_wake_tx_work(struct work_struct *ws)
if (result < 0) {
dev_err(dev, "WAKE&TX: error waiting for device to exit IDLE: "
"%d - resetting\n", result);
- i2400m_reset(i2400m, I2400M_RT_BUS);
- goto error;
+ goto reset_i2400m;
}
msleep(20); /* device still needs some time or it drops it */
result = i2400m_tx(i2400m, skb->data, skb->len, I2400M_PT_DATA);
-error:
+wake_queue:
netif_wake_queue(net_dev);
out_kfree:
kfree_skb(skb); /* refcount transferred by _hard_start_xmit() */
@@ -205,6 +203,11 @@ void i2400m_wake_tx_work(struct work_struct *ws)
i2400m_put(i2400m);
d_fnend(3, dev, "(ws %p i2400m %p skb %p) = void [%d]\n",
ws, i2400m, skb, result);
+ return;
+
+reset_i2400m:
+ i2400m_reset(i2400m, I2400M_RT_BUS);
+ goto wake_queue;
}
--
2.14.3
reply other threads:[~2017-10-29 17:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=62ad3417-8297-b763-ae49-bb8c097c2679@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=inaky.perez-gonzalez@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wimax@intel.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®