From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82CA9C76191 for ; Mon, 15 Jul 2019 09:44:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5ACAC2081C for ; Mon, 15 Jul 2019 09:44:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="WAVY+C9T"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="PINET64B" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729661AbfGOJom (ORCPT ); Mon, 15 Jul 2019 05:44:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41482 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729413AbfGOJol (ORCPT ); Mon, 15 Jul 2019 05:44:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4B0166049C; Mon, 15 Jul 2019 09:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1563183880; bh=ogNfDzJGeCchNe8Cj5MSCueMmkdzlA9bajadZwl42gg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WAVY+C9TLJZMiN4AxK19JddN/m8rBExJZ7kmfX90j6JcvPXD8ILrQC9gekhclHf3X BMyzf5Nk7lXra4iWjIqvG2f2Lz1GG/LeVX0VwMGvGPA789E2zLsxS7bKBtNwJlUc1O Ezt1fjkRrtkZEIUu4r8QylxIo2UjTjNBxMcYYliY= Received: from x230.qca.qualcomm.com (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 124296049C; Mon, 15 Jul 2019 09:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1563183879; bh=ogNfDzJGeCchNe8Cj5MSCueMmkdzlA9bajadZwl42gg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PINET64BOpNC1lwjrFMaoBGTtCsE3gP3joRwqkgtvCJGY9hHuiNwzzhRZDME6AW/V oY3AJ6i8ftdmCRgl3UlLTKeiIeKQLxuHbwKYrHq/oW9Ab4WnJ+fPTeVoHvS6h6+V9f Nf4aHZro33Q5X+ImkDUtsvNj/+MFYj6HNjM3ODPA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 124296049C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Arnd Bergmann Cc: Miaoqing Pan , "David S. Miller" , Rakesh Pillai , Brian Norris , Balaji Pothunoori , Wen Gong , Pradeep kumar Chitrapu , Sriram R , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] ath10k: work around uninitialized vht_pfr variable References: <20190708125050.3689133-1-arnd@arndb.de> Date: Mon, 15 Jul 2019 12:44:33 +0300 In-Reply-To: <20190708125050.3689133-1-arnd@arndb.de> (Arnd Bergmann's message of "Mon, 8 Jul 2019 14:50:06 +0200") Message-ID: <87v9w3pr7i.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Arnd Bergmann writes: > As clang points out, the vht_pfr is assigned to a struct member > without being initialized in one case: > > drivers/net/wireless/ath/ath10k/mac.c:7528:7: error: variable 'vht_pfr' is used uninitialized whenever 'if' condition > is false [-Werror,-Wsometimes-uninitialized] > if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7551:20: note: uninitialized use occurs here > arvif->vht_pfr = vht_pfr; > ^~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7528:3: note: remove the 'if' if its condition is always true > if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7483:12: note: initialize the variable 'vht_pfr' to silence this warning > u8 vht_pfr; > > Add an explicit but probably incorrect initialization here. > I suspect we want a better fix here, but chose this approach to > illustrate the issue. > > Fixes: 8b97b055dc9d ("ath10k: fix failure to set multiple fixed rate") > Signed-off-by: Arnd Bergmann I'll queue this for v5.3. -- Kalle Valo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hmxXG-0003fR-6q for ath10k@lists.infradead.org; Mon, 15 Jul 2019 09:44:43 +0000 From: Kalle Valo Subject: Re: [PATCH] ath10k: work around uninitialized vht_pfr variable References: <20190708125050.3689133-1-arnd@arndb.de> Date: Mon, 15 Jul 2019 12:44:33 +0300 In-Reply-To: <20190708125050.3689133-1-arnd@arndb.de> (Arnd Bergmann's message of "Mon, 8 Jul 2019 14:50:06 +0200") Message-ID: <87v9w3pr7i.fsf@codeaurora.org> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Arnd Bergmann Cc: Sriram R , Miaoqing Pan , Pradeep kumar Chitrapu , Balaji Pothunoori , Brian Norris , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, clang-built-linux@googlegroups.com, netdev@vger.kernel.org, Rakesh Pillai , Wen Gong , "David S. Miller" Arnd Bergmann writes: > As clang points out, the vht_pfr is assigned to a struct member > without being initialized in one case: > > drivers/net/wireless/ath/ath10k/mac.c:7528:7: error: variable 'vht_pfr' is used uninitialized whenever 'if' condition > is false [-Werror,-Wsometimes-uninitialized] > if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7551:20: note: uninitialized use occurs here > arvif->vht_pfr = vht_pfr; > ^~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7528:3: note: remove the 'if' if its condition is always true > if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/mac.c:7483:12: note: initialize the variable 'vht_pfr' to silence this warning > u8 vht_pfr; > > Add an explicit but probably incorrect initialization here. > I suspect we want a better fix here, but chose this approach to > illustrate the issue. > > Fixes: 8b97b055dc9d ("ath10k: fix failure to set multiple fixed rate") > Signed-off-by: Arnd Bergmann I'll queue this for v5.3. -- Kalle Valo _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k