ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
To: ath11k@lists.infradead.org
Subject: [PATCH bringup 1/3] ath11k: Clean ups in ath11k_ce_rx_buf_enqueue_pipe() error path
Date: Wed, 25 Sep 2019 10:14:16 +0530	[thread overview]
Message-ID: <1569386658-1325-1-git-send-email-vthiagar@codeaurora.org> (raw)

Unify the unlock/ring_access_end calls with error path in
ath11k_ce_rx_buf_enqueue_pipe(). Update to ce_pipe->rx_buf_needed
is done inside srng->lock before ath11k_hal_srng_access_end().
Also rename the goto label from err to exit.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/ce.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c
index c1b170c..205f28e 100644
--- a/drivers/net/wireless/ath/ath11k/ce.c
+++ b/drivers/net/wireless/ath/ath11k/ce.c
@@ -131,13 +131,13 @@ static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe,
 
 	if (unlikely(ath11k_hal_srng_src_num_free(ab, srng, false) < 1)) {
 		ret = -ENOSPC;
-		goto err;
+		goto exit;
 	}
 
 	desc = ath11k_hal_srng_src_get_next_entry(ab, srng);
 	if (!desc) {
 		ret = -ENOSPC;
-		goto err;
+		goto exit;
 	}
 
 	ath11k_hal_ce_dst_set_desc(desc, paddr);
@@ -146,15 +146,10 @@ static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe,
 	write_index = CE_RING_IDX_INCR(nentries_mask, write_index);
 	ring->write_index = write_index;
 
-	ath11k_hal_srng_access_end(ab, srng);
-
-	spin_unlock_bh(&srng->lock);
-
 	pipe->rx_buf_needed--;
 
-	return 0;
-
-err:
+	ret = 0;
+exit:
 	ath11k_hal_srng_access_end(ab, srng);
 
 	spin_unlock_bh(&srng->lock);
-- 
1.9.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

             reply	other threads:[~2019-09-25  4:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25  4:44 Vasanthakumar Thiagarajan [this message]
2019-09-25  4:44 ` [PATCH bringup 2/3] ath11k: Clean up parameter list in ath11k_ce_completed_send_next() Vasanthakumar Thiagarajan
2019-09-25  4:44 ` [PATCH bringup 3/3] ath11k: Use struct_size() to get the structure size with trailing array Vasanthakumar Thiagarajan
2019-09-27 14:52 ` [PATCH bringup 1/3] ath11k: Clean ups in ath11k_ce_rx_buf_enqueue_pipe() error path Kalle Valo
2019-09-27 14:55   ` Kalle Valo
2019-09-27 15:07 ` Kalle Valo

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=1569386658-1325-1-git-send-email-vthiagar@codeaurora.org \
    --to=vthiagar@codeaurora.org \
    --cc=ath11k@lists.infradead.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