Commit 8f4807a1 authored by Abhijeet Kolekar's avatar Abhijeet Kolekar Committed by John W. Linville

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: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dc4b1e7d
...@@ -4814,7 +4814,6 @@ static inline u16 iwl3945_get_active_dwell_time(struct iwl3945_priv *priv, ...@@ -4814,7 +4814,6 @@ static inline u16 iwl3945_get_active_dwell_time(struct iwl3945_priv *priv,
static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv, static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv,
enum ieee80211_band band) enum ieee80211_band band)
{ {
u16 active = iwl3945_get_active_dwell_time(priv, band);
u16 passive = (band == IEEE80211_BAND_2GHZ) ? u16 passive = (band == IEEE80211_BAND_2GHZ) ?
IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52; 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,9 +4828,6 @@ static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv,
passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2; passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
} }
if (passive <= active)
passive = active + 1;
return passive; return passive;
} }
...@@ -4856,6 +4852,9 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, ...@@ -4856,6 +4852,9 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv,
active_dwell = iwl3945_get_active_dwell_time(priv, band); active_dwell = iwl3945_get_active_dwell_time(priv, band);
passive_dwell = iwl3945_get_passive_dwell_time(priv, band); passive_dwell = iwl3945_get_passive_dwell_time(priv, band);
if (passive_dwell <= active_dwell)
passive_dwell = active_dwell + 1;
for (i = 0, added = 0; i < sband->n_channels; i++) { for (i = 0, added = 0; i < sband->n_channels; i++) {
if (channels[i].flags & IEEE80211_CHAN_DISABLED) if (channels[i].flags & IEEE80211_CHAN_DISABLED)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment