Search Linux Wireless

Re: [PATCH] iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

On Thu, 2010-07-22 at 12:28 -0700, John W. Linville wrote:
> 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.
> 
> Signed-off-by: John W. Linville <linville@xxxxxxxxxxxxx>
> ---
>  drivers/net/wireless/iwlwifi/iwl-agn-lib.c  |    5 ++++-
>  drivers/net/wireless/iwlwifi/iwl3945-base.c |    5 ++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> index 74623e0..0ca0df4 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 8eb3471..b102bab 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -2883,7 +2883,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;

Make sense, Thanks.

Wey

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux