From: John W. Linville Date: Thu, 22 Jul 2010 19:24:56 +0000 (-0400) Subject: iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6e492b9b5d323ca391312b981a5017e450132c0;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise The current practice of checking vif for NULL in one place but not another seems to confuse some static checkers, smatch in particular. Since vif will only be NULL in the case of internal scans, adjust the checks accordingly. Reported-by: Dan Carpenter Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index dda71cd9aab1..a1b6d202d57c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c @@ -1234,7 +1234,10 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); spin_lock_irqsave(&priv->lock, flags); - interval = vif ? vif->bss_conf.beacon_int : 0; + if (priv->is_internal_short_scan) + interval = 0; + else + interval = vif->bss_conf.beacon_int; spin_unlock_irqrestore(&priv->lock, flags); scan->suspend_time = 0; diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 9a7209d075c8..45a684575046 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -2881,7 +2881,10 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) IWL_DEBUG_INFO(priv, "Scanning while associated...\n"); spin_lock_irqsave(&priv->lock, flags); - interval = vif ? vif->bss_conf.beacon_int : 0; + if (priv->is_internal_short_scan) + interval = 0; + else + interval = vif->bss_conf.beacon_int; spin_unlock_irqrestore(&priv->lock, flags); scan->suspend_time = 0;