diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2013-08-13 14:59:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-14 17:42:59 -0400 |
commit | b02ccd5957281b7d2c364e5a34f3260961a691cb (patch) | |
tree | 7255b2e6232e918a8eb6baa34c5a8f70245caa37 | |
parent | 18ee00a6e10e54e6e5ebddba7913ee5738344297 (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.c | 50 |
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, | |||
389 | { | 389 | { |
390 | u32 uAckTime = 0; | 390 | u32 uAckTime = 0; |
391 | 391 | ||
392 | switch (byDurType) { | 392 | if (bNeedAck) { |
393 | 393 | if (byDurType == DATADUR_B) | |
394 | case DATADUR_B: //DATADUR_B | 394 | uAckTime = BBuGetFrameTime(pDevice->byPreambleType, |
395 | if (bNeedAck) { | 395 | byPktType, 14, pDevice->byTopCCKBasicRate); |
396 | uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate); | 396 | else |
397 | return (pDevice->uSIFS + uAckTime); | 397 | uAckTime = BBuGetFrameTime(pDevice->byPreambleType, |
398 | } else { | 398 | byPktType, 14, pDevice->byTopOFDMBasicRate); |
399 | return 0; | 399 | return pDevice->uSIFS + uAckTime; |
400 | } | 400 | } |
401 | break; | ||
402 | |||
403 | case DATADUR_A: //DATADUR_A | ||
404 | if(bNeedAck){ | ||
405 | uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate); | ||
406 | return (pDevice->uSIFS + uAckTime); | ||
407 | } else { | ||
408 | return 0; | ||
409 | } | ||
410 | break; | ||
411 | |||
412 | case DATADUR_A_F0: //DATADUR_A_F0 | ||
413 | if(bNeedAck){ | ||
414 | uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate); | ||
415 | return (pDevice->uSIFS + uAckTime); | ||
416 | } else { | ||
417 | return 0; | ||
418 | } | ||
419 | break; | ||
420 | |||
421 | case DATADUR_A_F1: //DATADUR_A_F1 | ||
422 | if(bNeedAck){ | ||
423 | uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate); | ||
424 | return (pDevice->uSIFS + uAckTime); | ||
425 | } else { | ||
426 | return 0; | ||
427 | } | ||
428 | break; | ||
429 | |||
430 | default: | ||
431 | break; | ||
432 | } | ||
433 | 401 | ||
434 | return 0; | 402 | return 0; |
435 | } | 403 | } |