staging: vt6655: extract index manupulation out of function call
This patch will remove if/else by selecting proper argument before function call, also index is updated before function call. Signed-off-by: Matej Dujava <mdujava@kocurkovo.cz> Link: https://lore.kernel.org/r/1588512552-12297-6-git-send-email-mdujava@kocurkovo.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ae25983134
commit
e3b8577aa1
@@ -266,7 +266,8 @@ s_uGetDataDuration(
|
||||
return 0;
|
||||
} else {
|
||||
/* First Frag or Mid Frag */
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, len, wRate, bNeedAck);
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType,
|
||||
len, wRate, bNeedAck);
|
||||
}
|
||||
|
||||
return pDevice->uSIFS + uAckTime + uNextPktTime;
|
||||
@@ -283,8 +284,8 @@ s_uGetDataDuration(
|
||||
return 0;
|
||||
} else {
|
||||
/* First Frag or Mid Frag */
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, len,
|
||||
wRate, bNeedAck);
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType,
|
||||
len, wRate, bNeedAck);
|
||||
}
|
||||
|
||||
return pDevice->uSIFS + uAckTime + uNextPktTime;
|
||||
@@ -307,17 +308,15 @@ s_uGetDataDuration(
|
||||
else if (wRate > RATE_54M)
|
||||
wRate = RATE_54M;
|
||||
|
||||
if (byFBOption == AUTO_FB_0) {
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice,
|
||||
byPktType, len,
|
||||
wFB_Opt0[FB_RATE0][wRate - RATE_18M],
|
||||
bNeedAck);
|
||||
} else {
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice,
|
||||
byPktType, len,
|
||||
wFB_Opt1[FB_RATE0][wRate - RATE_18M],
|
||||
bNeedAck);
|
||||
}
|
||||
wRate -= RATE_18M;
|
||||
|
||||
if (byFBOption == AUTO_FB_0)
|
||||
wRate = wFB_Opt0[FB_RATE0][wRate];
|
||||
else
|
||||
wRate = wFB_Opt1[FB_RATE0][wRate];
|
||||
|
||||
uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType,
|
||||
len, wRate, bNeedAck);
|
||||
}
|
||||
|
||||
return pDevice->uSIFS + uAckTime + uNextPktTime;
|
||||
|
||||
Reference in New Issue
Block a user