]> git.baikalelectronics.ru Git - kernel.git/commit
ath11k: Silence clang -Wsometimes-uninitialized in ath11k_update_per_peer_stats_from_...
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 30 Jan 2020 01:59:05 +0000 (18:59 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 11 Feb 2020 14:23:55 +0000 (16:23 +0200)
commitfe3fdaf3ed6b31c08c2657a3298624c06d73a518
tree2d756caa367a2a52792020b7fc242eb2faf964ac
parentd541f57bad1a0fdd9903ea88235330b427285893
ath11k: Silence clang -Wsometimes-uninitialized in ath11k_update_per_peer_stats_from_txcompl

Clang warns a few times (trimmed for brevity):

../drivers/net/wireless/ath/ath11k/debugfs_sta.c:185:7: warning:
variable 'rate_idx' is used uninitialized whenever 'if' condition is
false [-Wsometimes-uninitialized]

It is not wrong, rate_idx is only initialized in the first if block.
However, this is not necessarily an issue in practice because rate_idx
will only be used when initialized because
ath11k_accumulate_per_peer_tx_stats only uses rate_idx when flags is not
set to RATE_INFO_FLAGS_HE_MCS, RATE_INFO_FLAGS_VHT_MCS, or
RATE_INFO_FLAGS_MCS. Still, it is not good to stick uninitialized values
into another function so initialize it to zero to prevent any issues
down the line.

Fixes: 8d15e0365d69 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Link: https://github.com/ClangBuiltLinux/linux/issues/832
Reported-by: ci_notify@linaro.org
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath11k/debugfs_sta.c