summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2013-08-13 19:59:31 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-14 14:42:59 -0700
commitb02ccd5957281b7d2c364e5a34f3260961a691cb (patch)
tree7255b2e6232e918a8eb6baa34c5a8f70245caa37
parent18ee00a6e10e54e6e5ebddba7913ee5738344297 (diff)
staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure.
A value is only returned when bNeedAck is true. Only when byDurType == DATADUR_B is different. Remove switch statement and simplify with if structure. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/vt6656/rxtx.c50
1 files changed, 9 insertions, 41 deletions
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index c8e3e7e85cbe..a701120e6493 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -389,47 +389,15 @@ static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
{
u32 uAckTime = 0;
- switch (byDurType) {
-
- case DATADUR_B: //DATADUR_B
- if (bNeedAck) {
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- case DATADUR_A: //DATADUR_A
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- case DATADUR_A_F0: //DATADUR_A_F0
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- case DATADUR_A_F1: //DATADUR_A_F1
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- default:
- break;
- }
+ if (bNeedAck) {
+ if (byDurType == DATADUR_B)
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
+ byPktType, 14, pDevice->byTopCCKBasicRate);
+ else
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
+ byPktType, 14, pDevice->byTopOFDMBasicRate);
+ return pDevice->uSIFS + uAckTime;
+ }
return 0;
}