2020-05-03 15:46:08

by Matej Dujava

[permalink] [raw]
Subject: [PATCH v2 0/2] Early return in s_uGetTxRsvTime

This patch set will fix checkpatch LONG_LINE warnings and will save us
one call of bb_get_frame_time in case od !bNeedAck.

Change history:
v2: Implemented advice of ternary operator from Joe Perches <[email protected]>

Matej Dujava (2):
staging: vt6655: return early if not bNeedAck
staging: vt6655: fix LONG_LINE warning

drivers/staging/vt6655/rxtx.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

--
2.26.2


2020-05-03 15:48:16

by Matej Dujava

[permalink] [raw]
Subject: [PATCH v2 2/2] staging: vt6655: fix LONG_LINE warning

This patch will fix LONG_LINE error from checkpatch, by using ternary
operator.

Signed-off-by: Matej Dujava <[email protected]>
---
drivers/staging/vt6655/rxtx.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index dda578436e64..994c19f1de43 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -170,10 +170,14 @@ s_uGetTxRsvTime(
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);
+ /*
+ * CCK mode - 11b
+ * OFDM mode - 11g 2.4G & 11a 5G
+ */
+ uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14,
+ byPktType == PK_TYPE_11B ?
+ pDevice->byTopCCKBasicRate :
+ pDevice->byTopOFDMBasicRate);

return uDataTime + pDevice->uSIFS + uAckTime;
}
--
2.26.2