public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roberto Rodriguez Alkala <rralcala@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>,
	Joe Perches <joe@perches.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] stating: otus: fix compile warning and some style issues
Date: Sat, 07 Aug 2010 19:52:29 -0400	[thread overview]
Message-ID: <1281225149.10826.5.camel@lenovo> (raw)

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>
---
 drivers/staging/otus/80211core/ratectrl.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/otus/80211core/ratectrl.c b/drivers/staging/otus/80211core/ratectrl.c
index a1abe2f..283b2b5 100644
--- a/drivers/staging/otus/80211core/ratectrl.c
+++ b/drivers/staging/otus/80211core/ratectrl.c
@@ -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);
-- 
1.7.0.4




             reply	other threads:[~2010-08-07 23:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-07 23:52 Roberto Rodriguez Alkala [this message]
2010-08-08 15:17 ` [PATCH] stating: otus: fix compile warning and some style issues walter harms

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281225149.10826.5.camel@lenovo \
    --to=rralcala@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox