From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail26.static.mailgun.info ([104.130.122.26]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1WSm-0002rZ-2G for ath11k@lists.infradead.org; Tue, 11 Feb 2020 14:24:33 +0000 MIME-Version: 1.0 Subject: Re: [PATCH] ath11k: Silence clang -Wsometimes-uninitialized in ath11k_update_per_peer_stats_from_txcompl From: Kalle Valo In-Reply-To: <20200130015905.18610-1-natechancellor@gmail.com> References: <20200130015905.18610-1-natechancellor@gmail.com> Message-Id: <20200211142431.57B36C43383@smtp.codeaurora.org> Date: Tue, 11 Feb 2020 14:24:31 +0000 (UTC) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath11k" Errors-To: ath11k-bounces+kvalo=adurom.com@lists.infradead.org To: Nathan Chancellor Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, ci_notify@linaro.org, ath11k@lists.infradead.org Nathan Chancellor wrote: > 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: d5c65159f289 ("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 > Reviewed-by: Nick Desaulniers > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. df57acc415b1 ath11k: Silence clang -Wsometimes-uninitialized in ath11k_update_per_peer_stats_from_txcompl -- https://patchwork.kernel.org/patch/11357331/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k