[v4,7/8] bus/vmbus: simplify args to need_signal
diff mbox series

Message ID 20200331171404.23596-8-stephen@networkplumber.org
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/netvsc: bug fixes
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger March 31, 2020, 5:14 p.m. UTC
The transmit need signal function can avoid an unnecessary
dereference by passing the right pointer. This also makes
code better match FreeBSD driver.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/vmbus/vmbus_bufring.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/drivers/bus/vmbus/vmbus_bufring.c b/drivers/bus/vmbus/vmbus_bufring.c
index c88001605dbb..c4aa07b307ff 100644
--- a/drivers/bus/vmbus/vmbus_bufring.c
+++ b/drivers/bus/vmbus/vmbus_bufring.c
@@ -54,10 +54,10 @@  void vmbus_br_setup(struct vmbus_br *br, void *buf, unsigned int blen)
  *   data have arrived.
  */
 static inline bool
-vmbus_txbr_need_signal(const struct vmbus_br *tbr, uint32_t old_windex)
+vmbus_txbr_need_signal(const struct vmbus_bufring *vbr, uint32_t old_windex)
 {
 	rte_smp_mb();
-	if (tbr->vbr->imask)
+	if (vbr->imask)
 		return false;
 
 	rte_smp_rmb();
@@ -66,7 +66,7 @@  vmbus_txbr_need_signal(const struct vmbus_br *tbr, uint32_t old_windex)
 	 * This is the only case we need to signal when the
 	 * ring transitions from being empty to non-empty.
 	 */
-	return old_windex == tbr->vbr->rindex;
+	return old_windex == vbr->rindex;
 }
 
 static inline uint32_t
@@ -163,7 +163,7 @@  vmbus_txbr_write(struct vmbus_br *tbr, const struct iovec iov[], int iovlen,
 		rte_pause();
 
 	/* If host had read all data before this, then need to signal */
-	*need_sig |= vmbus_txbr_need_signal(tbr, old_windex);
+	*need_sig |= vmbus_txbr_need_signal(vbr, old_windex);
 	return 0;
 }