]> Pileus Git - ~andy/linux/commitdiff
staging: otus: fix compile warning and some style issues
authorRoberto Rodriguez Alkala <rralcala@gmail.com>
Sat, 7 Aug 2010 23:52:29 +0000 (19:52 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 18:52:30 +0000 (11:52 -0700)
In today linux-next I got a compile warning in staging/otus driver.
This patch solves the issue and also improves the coding style.

Signed-off-by: Roberto Rodriguez Alcala <rralcala@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/otus/80211core/ratectrl.c

index a1abe2f4f342247571ac7a6a9a252583f7eb60cc..283b2b52638c26f065ac9fea69b39f836d9ce001 100644 (file)
@@ -422,23 +422,15 @@ u8_t zfRateCtrlRateDiff(struct zsRcCell* rcCell, u8_t retryRate)
     u16_t i;
 
     /* Find retryRate in operationRateSet[] */
-    for (i=0; i<rcCell->operationRateCount; i++)
-    {
-        if (retryRate == rcCell->operationRateSet[i])
-        {
-            if (i < rcCell->currentRateIndex)
-            {
-                return ((rcCell->currentRateIndex - i)+1)>>1;
-            }
-            else if (i == rcCell->currentRateIndex == 0)
-            {
-                return 1;
-            }
-            else
-            {
-                return 0;
-            }
-        }
+    for (i = 0; i < rcCell->operationRateCount; i++) {
+       if (retryRate == rcCell->operationRateSet[i]) {
+               if (i < rcCell->currentRateIndex)
+                       return ((rcCell->currentRateIndex - i)+1)>>1;
+               else if (i == rcCell->currentRateIndex && i == 0)
+                       return 1;
+               else
+                       return 0;
+       }
     }
     /* TODO : retry rate not in operation rate set */
     zm_msg1_tx(ZM_LV_0, "Not in operation rate set:", retryRate);