Search Linux Wireless

Re: [PATCH] net: wireless: wcn36xx: Handle scan initialization error

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

 



Loic Poulain <loic.poulain@xxxxxxxxxx> writes:

> In case firmware is not able to initialize scanning, return
> an error to skip scanning on the channel. Scan initialization
> can fail, if e.g. the firmware is not able to submit the null
> function packet with PS bit set.
>
> Signed-off-by: Loic Poulain <loic.poulain@xxxxxxxxxx>

No "net: wireless:" in the title, please.

> --- a/drivers/net/wireless/ath/wcn36xx/main.c
> +++ b/drivers/net/wireless/ath/wcn36xx/main.c
> @@ -433,8 +433,11 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed)
>  			/* A scan is ongoing, do not change the operating
>  			 * channel, but start a scan session on the channel.
>  			 */
> -			wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN,
> -					      wcn->sw_scan_vif);
> +			if (wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN,
> +						  wcn->sw_scan_vif)) {
> +				mutex_unlock(&wcn->conf_mutex);
> +				return -EIO;
> +			}

Why are you rewriting the error code from wcn36xx_smd_init_scan()?

Also I think this style is more readable (which does not rewrite the
error code either):

ret = foo();
if (ret) {
    ...
}

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux