diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2008-09-02 23:26:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-08 14:23:16 -0400 |
commit | 8f4807a122d3ef680ae85c71f0b49ba8ec6d904a (patch) | |
tree | 756970801526fb91630a9edd1ff4e282a5defdd4 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | dc4b1e7dda331c64dacd794a9380d4cff8547cce (diff) |
iwl3945: avoid redundant iwl3945_get_active_dwell_time
iwl3945_get_active_dwell_time is called twice within the same context.
The patch removes one instance.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index f0081ded6dd6..e3be7f4c648f 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4814,7 +4814,6 @@ static inline u16 iwl3945_get_active_dwell_time(struct iwl3945_priv *priv, | |||
4814 | static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv, | 4814 | static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv, |
4815 | enum ieee80211_band band) | 4815 | enum ieee80211_band band) |
4816 | { | 4816 | { |
4817 | u16 active = iwl3945_get_active_dwell_time(priv, band); | ||
4818 | u16 passive = (band == IEEE80211_BAND_2GHZ) ? | 4817 | u16 passive = (band == IEEE80211_BAND_2GHZ) ? |
4819 | IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : | 4818 | IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : |
4820 | IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52; | 4819 | IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52; |
@@ -4829,9 +4828,6 @@ static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv, | |||
4829 | passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2; | 4828 | passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2; |
4830 | } | 4829 | } |
4831 | 4830 | ||
4832 | if (passive <= active) | ||
4833 | passive = active + 1; | ||
4834 | |||
4835 | return passive; | 4831 | return passive; |
4836 | } | 4832 | } |
4837 | 4833 | ||
@@ -4856,6 +4852,9 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, | |||
4856 | active_dwell = iwl3945_get_active_dwell_time(priv, band); | 4852 | active_dwell = iwl3945_get_active_dwell_time(priv, band); |
4857 | passive_dwell = iwl3945_get_passive_dwell_time(priv, band); | 4853 | passive_dwell = iwl3945_get_passive_dwell_time(priv, band); |
4858 | 4854 | ||
4855 | if (passive_dwell <= active_dwell) | ||
4856 | passive_dwell = active_dwell + 1; | ||
4857 | |||
4859 | for (i = 0, added = 0; i < sband->n_channels; i++) { | 4858 | for (i = 0, added = 0; i < sband->n_channels; i++) { |
4860 | if (channels[i].flags & IEEE80211_CHAN_DISABLED) | 4859 | if (channels[i].flags & IEEE80211_CHAN_DISABLED) |
4861 | continue; | 4860 | continue; |