All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure
@ 2013-08-07 20:33 Malcolm Priestley
  2013-08-12 22:27 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Malcolm Priestley @ 2013-08-07 20:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

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>
---
 drivers/staging/vt6656/rxtx.c | 50 ++++++++-----------------------------------
 1 file changed, 9 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 70a30d9..42f0823 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);switch
-            } 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;
 }
-- 
1.8.1.2







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

* Re: [PATCH 4/4] staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure
  2013-08-07 20:33 [PATCH 4/4] staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure Malcolm Priestley
@ 2013-08-12 22:27 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2013-08-12 22:27 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: linux-wireless

On Wed, Aug 07, 2013 at 09:33:08PM +0100, Malcolm Priestley wrote:
> 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>

This one didn't apply due to other patches I didn't apply in your
previous ones.

Can you redo all of these and resend them against my staging-next tree
so that I can apply them?

thanks,

greg k-h

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

end of thread, other threads:[~2013-08-12 22:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-07 20:33 [PATCH 4/4] staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure Malcolm Priestley
2013-08-12 22:27 ` Greg KH

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.