[PATCH] wcn36xx: Fix max channels retrieval

Kalle Valo kvalo at kernel.org
Wed Dec 8 00:34:19 PST 2021


Loic Poulain <loic.poulain at linaro.org> wrote:

> Kernel test robot reported:drivers/net/wireless/ath/wcn36xx/smd.c:943:33:
>    sparse: sparse: cast truncates bits from constant value (780 becomes 80)
> 
> The 'channels' field is not a simple u8 array but an array of
> channel_params. Using sizeof for retrieving the max number of
> channels is then wrong.
> 
> In practice, it was not an issue, because the sizeof returned
> value is 780, which is truncated in min_t (u8) to 80, which is
> the value we expect...
> 
> Fix that properly using ARRAY_SIZE instead of sizeof.
> 
> Fixes: d707f812bb05 ("wcn36xx: Channel list update before hardware scan")
> Reported-by: kernel test robot <lkp at intel.com>
> Signed-off-by: Loic Poulain <loic.poulain at linaro.org>
> Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

09cab4308bf9 wcn36xx: Fix max channels retrieval

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/1638435732-14657-1-git-send-email-loic.poulain@linaro.org/

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




More information about the wcn36xx mailing list