linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Zhu Yi <yi.zhu@intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH] iwlwifi: rs_rate_scale_perform clean up
Date: Thu, 27 Sep 2007 11:27:41 +0800	[thread overview]
Message-ID: <11908636801368-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1190863679136-git-send-email-yi.zhu@intel.com>

This patch cleans up rs_rate_scale_perform function. It removes dead
code, shortens variable names and removes useless return i.e. function
now returns void.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index bad7466..c4b8ca1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -131,7 +131,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 				   struct net_device *dev,
 				   struct ieee80211_hdr *hdr,
 				   struct sta_info *sta);
-static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
+static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_rate *tx_mcs,
 			     struct iwl_link_quality_cmd *tbl);
 
@@ -1873,16 +1873,15 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 	rs_initialize_lq(priv, sta);
 }
 
-static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
+static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			    struct iwl_rate *tx_mcs,
 			    struct iwl_link_quality_cmd *lq_cmd)
 {
 	int index = 0;
-	int rc = 0;
 	int rate_idx;
+	int repeat_rate = 0;
 	u8 ant_toggle_count = 0;
 	u8 use_ht_possible = 1;
-	u8 repeat_cur_rate = 0;
 	struct iwl_rate new_rate;
 	struct iwl_scale_tbl_info tbl_type = { 0 };
 
@@ -1891,9 +1890,9 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 
 	if (is_legacy(tbl_type.lq_type)) {
 		ant_toggle_count = 1;
-		repeat_cur_rate = IWL_NUMBER_TRY;
+		repeat_rate = IWL_NUMBER_TRY;
 	} else
-		repeat_cur_rate = IWL_HT_NUMBER_TRY;
+		repeat_rate = IWL_HT_NUMBER_TRY;
 
 	lq_cmd->general_params.mimo_delimiter =
 			is_mimo(tbl_type.lq_type) ? 1 : 0;
@@ -1907,10 +1906,10 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 		lq_cmd->general_params.single_stream_ant_msk = 2;
 
 	index++;
-	repeat_cur_rate--;
+	repeat_rate--;
 
 	while (index < LINK_QUAL_MAX_RETRY_NUM) {
-		while (repeat_cur_rate && (index < LINK_QUAL_MAX_RETRY_NUM)) {
+		while (repeat_rate > 0 && (index < LINK_QUAL_MAX_RETRY_NUM)) {
 			if (is_legacy(tbl_type.lq_type)) {
 				if (ant_toggle_count <
 				    NUM_TRY_BEFORE_ANTENNA_TOGGLE)
@@ -1922,7 +1921,7 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			}
 			lq_cmd->rs_table[index].rate_n_flags =
 					cpu_to_le32(new_rate.rate_n_flags);
-			repeat_cur_rate--;
+			repeat_rate--;
 			index++;
 		}
 
@@ -1942,26 +1941,22 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 				rs_toggle_antenna(&new_rate, &tbl_type);
 				ant_toggle_count = 1;
 			}
-			repeat_cur_rate = IWL_NUMBER_TRY;
+			repeat_rate = IWL_NUMBER_TRY;
 		} else
-			repeat_cur_rate = IWL_HT_NUMBER_TRY;
+			repeat_rate = IWL_HT_NUMBER_TRY;
 
 		use_ht_possible = 0;
 
 		lq_cmd->rs_table[index].rate_n_flags =
 				cpu_to_le32(new_rate.rate_n_flags);
-		/* lq_cmd->rs_table[index].rate_n_flags = 0x800d; */
 
 		index++;
-		repeat_cur_rate--;
+		repeat_rate--;
 	}
 
-	/* lq_cmd->rs_table[0].rate_n_flags = 0x800d; */
-
 	lq_cmd->general_params.dual_stream_ant_msk = 3;
 	lq_cmd->agg_params.agg_dis_start_th = 3;
 	lq_cmd->agg_params.agg_time_limit = cpu_to_le16(4000);
-	return rc;
 }
 
 static void *rs_alloc(struct ieee80211_local *local)
-- 
1.5.1

  reply	other threads:[~2007-09-27  3:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11908636643693-git-send-email-yi.zhu@intel.com>
2007-09-27  3:27 ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Zhu Yi
2007-09-27  3:27   ` [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle Zhu Yi
2007-09-27  3:27     ` [PATCH] iwlwifi: Correction for sending beacon in config_ap Zhu Yi
2007-09-27  3:27       ` [PATCH] iwlwifi: clear station table in rxon unconditionally Zhu Yi
2007-09-27  3:27         ` [PATCH] iwlwifi: Fix typo in rate sacling algorithm Zhu Yi
2007-09-27  3:27           ` [PATCH] iwlwifi: fix add_station to avoid FW error Zhu Yi
2007-09-27  3:27             ` [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale Zhu Yi
2007-09-27  3:27               ` [PATCH] iwlwifi: add debugfs framework to " Zhu Yi
2007-09-27  3:27                 ` [PATCH] iwlwifi: add read rate scale table debugfs function Zhu Yi
2007-09-27  3:27                   ` [PATCH] iwlwifi: limit printouts on hot path Zhu Yi
2007-09-27  3:27                     ` [PATCH] iwlwifi: add supp_rates to rate scale sta private data Zhu Yi
2007-09-27  3:27                       ` Zhu Yi [this message]
2007-09-27  3:27                         ` [PATCH] iwlwifi: set fixed rate through debugfs Zhu Yi
2007-09-27  3:27                           ` [PATCH] iwlwifi: add debugfs rate scale stats Zhu Yi
2007-09-27  3:27                             ` [PATCH] iwlwifi: Update iwlwifi version stamp to 1.1.17 Zhu Yi
2007-09-27  4:35                           ` [PATCH] iwlwifi: set fixed rate through debugfs Randy Dunlap
2007-09-27  4:43                             ` Zhu Yi
2007-09-27 14:26                               ` Randy Dunlap
2007-09-28  7:44                                 ` Tomas Winkler
2007-09-27  4:32   ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Randy Dunlap
2007-09-27  4:42     ` Zhu Yi
2007-09-27 20:41 ` iwlwifi driver updates John W. Linville

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=11908636801368-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomas.winkler@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).