All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: vt6655: return early if not bNeedAck
@ 2020-05-02 22:16 ` Matej Dujava
  0 siblings, 0 replies; 8+ messages in thread
From: Matej Dujava @ 2020-05-02 22:16 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, devel, linux-kernel
  Cc: Stefano Brivio, Briana Oursler, Frank A. Cancio Bello, Matej Dujava

This patch will check for bNeedAck before making bb_get_frame_time call, so
in case we dont need uAckTime, we can return early.

Signed-off-by: Matej Dujava <mdujava@kocurkovo.cz>
---
 drivers/staging/vt6655/rxtx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 2f9c2ead3cb8..dda578436e64 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -166,15 +166,16 @@ s_uGetTxRsvTime(
 	unsigned int uDataTime, uAckTime;
 
 	uDataTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, cbFrameLength, wRate);
+
+	if (!bNeedAck)
+		return uDataTime;
+
 	if (byPktType == PK_TYPE_11B) /* llb,CCK mode */
 		uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopCCKBasicRate);
 	else /* 11g 2.4G OFDM mode & 11a 5G OFDM mode */
 		uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopOFDMBasicRate);
 
-	if (bNeedAck)
-		return uDataTime + pDevice->uSIFS + uAckTime;
-	else
-		return uDataTime;
+	return uDataTime + pDevice->uSIFS + uAckTime;
 }
 
 static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-03  9:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02 22:16 [PATCH 1/2] staging: vt6655: return early if not bNeedAck Matej Dujava
2020-05-02 22:16 ` Matej Dujava
2020-05-02 22:16 ` [PATCH 2/2] staging: vt6655: fix LONG_LINE warning Matej Dujava
2020-05-02 22:16   ` Matej Dujava
2020-05-03  5:11   ` Joe Perches
2020-05-03  5:11     ` Joe Perches
2020-05-03  9:15     ` Matej Dujava
2020-05-03  9:15       ` Matej Dujava

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.