From: Jerome Pouiller <Jerome.Pouiller@silabs.com>
To: linux-wireless@vger.kernel.org, Kalle Valo <kvalo@kernel.org>
Cc: devel@driverdev.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jérôme Pouiller" <jerome.pouiller@silabs.com>
Subject: [PATCH 07/10] staging: wfx: remove duplicated code in wfx_cmd_send()
Date: Fri, 25 Feb 2022 12:24:02 +0100 [thread overview]
Message-ID: <20220225112405.355599-8-Jerome.Pouiller@silabs.com> (raw)
In-Reply-To: <20220225112405.355599-1-Jerome.Pouiller@silabs.com>
From: Jérôme Pouiller <jerome.pouiller@silabs.com>
The code to execute on end of the function is the same whatever the
command replies or not.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
drivers/staging/wfx/hif_tx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 236f9d62e3a9..0b1ed12c0e83 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -74,9 +74,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
if (no_reply) {
/* Chip won't reply. Give enough time to the wq to send the buffer. */
msleep(100);
- wdev->hif_cmd.buf_send = NULL;
- mutex_unlock(&wdev->hif_cmd.lock);
- return 0;
+ ret = 0;
+ goto end;
}
if (wdev->poll_irq)
@@ -98,6 +97,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
ret = wdev->hif_cmd.ret;
}
+end:
wdev->hif_cmd.buf_send = NULL;
mutex_unlock(&wdev->hif_cmd.lock);
--
2.34.1
next prev parent reply other threads:[~2022-02-25 11:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 11:23 [PATCH 00/10] staging: wfx: usual maintenance Jerome Pouiller
2022-02-25 11:23 ` [PATCH 01/10] staging: wfx: sta.o was linked twice Jerome Pouiller
2022-02-25 11:23 ` [PATCH 02/10] staging: wfx: fix struct alignment Jerome Pouiller
2022-02-25 11:23 ` [PATCH 03/10] staging: wfx: format comments on 100 columns Jerome Pouiller
2022-03-01 1:12 ` Joe Perches
2022-03-01 17:13 ` Jeff Johnson
2022-02-25 11:23 ` [PATCH 04/10] staging: wfx: format code " Jerome Pouiller
2022-02-25 11:24 ` [PATCH 05/10] staging: wfx: remove useless variable Jerome Pouiller
2022-02-25 11:24 ` [PATCH 06/10] staging: wfx: drop useless include Jerome Pouiller
2022-02-25 11:24 ` Jerome Pouiller [this message]
2022-02-25 11:24 ` [PATCH 08/10] staging: wfx: prefer to wait for an event instead to sleep Jerome Pouiller
2022-02-25 11:24 ` [PATCH 09/10] staging: wfx: ensure HIF request has been sent before polling Jerome Pouiller
2022-02-25 11:24 ` [PATCH 10/10] staging: wfx: flags for SPI IRQ were ignored Jerome Pouiller
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=20220225112405.355599-8-Jerome.Pouiller@silabs.com \
--to=jerome.pouiller@silabs.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--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®