From patchwork Fri May 20 19:43:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857398 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7656CC433F5 for ; Fri, 20 May 2022 19:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353284AbiETTn3 (ORCPT ); Fri, 20 May 2022 15:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350599AbiETTn0 (ORCPT ); Fri, 20 May 2022 15:43:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA2F8199484; Fri, 20 May 2022 12:43:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 600C161BD2; Fri, 20 May 2022 19:43:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89B44C36AE3; Fri, 20 May 2022 19:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075804; bh=EwW7HzXO9OKUwDAZY6TpEn7xpcCwzkVGJ3mCzpAXN4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ar6Ol3wXT9GvdWiMdsj3gwdG0HFN50K60lf+wct7esGB2CGyNr4fqsy3xTmmteGyj yCXD20+7pPWh+q6tiTFsTGAvsNwhqA2LkiSIuVoj/RuI1phxe1DsOftK62reeS5oxI 4nSvILa5g3DKKeWw1FoMCqp/T8Y17QOlK3jCz8LxKr0nwdcFRu2Q81dzc/SFBfmbpo T41+gXTpAUc7JIT5qt+25Z9c2D4hxUiRsZsALzcXlCfrIsHBNWANlpYE1ZALrzO6uK XNsZIwBB4r/X8h/G2UUPnZ5yCb/4fDBmheaElbi2eWnM54xW4rLt7fhWCy2bxAS2q8 qPyQTsSdEn8DA== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , srini.raju@purelifi.com Subject: [PATCH net-next 1/8] wifi: plfxlc: remove redundant NULL-check for GCC 12 Date: Fri, 20 May 2022 12:43:13 -0700 Message-Id: <20220520194320.2356236-2-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org GCC is upset that we check the return value of plfxlc_usb_dev() even tho it can't be NULL: drivers/net/wireless/purelifi/plfxlc/usb.c: In function ‘resume’: drivers/net/wireless/purelifi/plfxlc/usb.c:840:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘dev’ will never be NULL [-Waddress] 840 | if (!pl || !plfxlc_usb_dev(pl)) | ^ plfxlc_usb_dev() returns an address of one of the members of pl, so it's safe to drop these checks. Signed-off-by: Jakub Kicinski --- CC: srini.raju@purelifi.com CC: kvalo@kernel.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/purelifi/plfxlc/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c index d0e98b2f1365..8519cf0adfff 100644 --- a/drivers/net/wireless/purelifi/plfxlc/usb.c +++ b/drivers/net/wireless/purelifi/plfxlc/usb.c @@ -824,7 +824,7 @@ static int suspend(struct usb_interface *interface, struct plfxlc_usb *pl = get_plfxlc_usb(interface); struct plfxlc_mac *mac = plfxlc_usb_to_mac(pl); - if (!pl || !plfxlc_usb_dev(pl)) + if (!pl) return -ENODEV; if (pl->initialized == 0) return 0; @@ -837,7 +837,7 @@ static int resume(struct usb_interface *interface) { struct plfxlc_usb *pl = get_plfxlc_usb(interface); - if (!pl || !plfxlc_usb_dev(pl)) + if (!pl) return -ENODEV; if (pl->was_running) plfxlc_usb_resume(pl); From patchwork Fri May 20 19:43:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857400 X-Patchwork-Delegate: toke@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C6ABC433FE for ; Fri, 20 May 2022 19:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353281AbiETTnd (ORCPT ); Fri, 20 May 2022 15:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353279AbiETTn0 (ORCPT ); Fri, 20 May 2022 15:43:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C2AC199487; Fri, 20 May 2022 12:43:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ADB2B61BD5; Fri, 20 May 2022 19:43:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E31A8C36AE5; Fri, 20 May 2022 19:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075805; bh=Zsa+f6JCTzDTQi/tJsr1BPpvgwcSPn0bBlCB7MGA9x8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ATxhh3SCoyDIvjyBnvDp4a5iDHXO6AYZTxT4uh62WYvhDH9bg1PjaDtpVacHPWJg8 KaCYgOQGaU5btpo0MDAAJyW0E1qP9ni2xhONFs/P4EIXICfuW94kn847Q7iwu+/Zdm 65GKUGV9ZgCqfShZwtAmN06mQujISyeCfJIALXC+5tLqJ5nkqD2MBqnTKZ8YBmUL6N tdEG+Hb4aFa4IWmQMdUtI3EpEaYrH6g1WSUyCGr26I7IvqqfDPgwO7YN3qMplogXn9 IpPWDL4hQ+LV4WidaU+j2cvR4FZev3JP8jER77ndRiv3HyNlblSnbjptLsd6vm5AqY L+15LmfZFt79w== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , toke@toke.dk Subject: [PATCH net-next 2/8] wifi: ath9k: silence array-bounds warning on GCC 12 Date: Fri, 20 May 2022 12:43:14 -0700 Message-Id: <20220520194320.2356236-3-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org GCC 12 says: drivers/net/wireless/ath/ath9k/mac.c: In function ‘ath9k_hw_resettxqueue’: drivers/net/wireless/ath/ath9k/mac.c:373:22: warning: array subscript 32 is above array bounds of ‘struct ath9k_tx_queue_info[10]’ [-Warray-bounds] 373 | qi = &ah->txq[q]; | ~~~~~~~^~~ I don't know where it got the 32 from, relegate the warning to W=1+. Signed-off-by: Jakub Kicinski --- CC: toke@toke.dk CC: kvalo@kernel.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/ath/ath9k/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile index eff94bcd1f0a..9bdfcee2f448 100644 --- a/drivers/net/wireless/ath/ath9k/Makefile +++ b/drivers/net/wireless/ath/ath9k/Makefile @@ -45,6 +45,11 @@ ath9k_hw-y:= \ ar9003_eeprom.o \ ar9003_paprd.o +# FIXME: temporarily silence -Warray-bounds on non W=1+ builds +ifndef KBUILD_EXTRA_WARN +CFLAGS_mac.o += -Wno-array-bounds +endif + ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \ From patchwork Fri May 20 19:43:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857401 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EDABC4332F for ; Fri, 20 May 2022 19:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353297AbiETTne (ORCPT ); Fri, 20 May 2022 15:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345377AbiETTn1 (ORCPT ); Fri, 20 May 2022 15:43:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C447197F72; Fri, 20 May 2022 12:43:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2285061BCB; Fri, 20 May 2022 19:43:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46502C3411B; Fri, 20 May 2022 19:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075805; bh=zGEKpWgxn6+HzxRExsmr65/JbhM8cdKYs1r7XpE7LVo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tAEizluf/Lvw7UjOI6blqS8JaisSYAFnkJU9OakFjV3yMwJnswPbFoC5fPbGBBBLB YBtoSA9zXWVGcF7jxBeV1opoyh+LV5Msiu1sddlEQ6RQeWAzjJuduKJZmwYlxeA+Lh cKu7h72tFdAYZ+qSrjNCSunPrq0NL4Iid95/mwxCUO37IfOGYH241xqakmIYiLzkDB 3yuo2LsCDQQ4gyTWzbSax3f2O2CYEo0oJMDeZf02+v5zZmaLHmrOO7Gs/clI7kgphj 7lp2QMwvirvdUXaxTCNuSzGci0oacq0N8QLKvWL2IVu9wTBtoTO8UgKl2RTQQWNjHG CxmOMFnRXr12Q== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , pkshih@realtek.com, keescook@chromium.org, colin.king@intel.com Subject: [PATCH net-next 3/8] wifi: rtlwifi: remove always-true condition pointed out by GCC 12 Date: Fri, 20 May 2022 12:43:15 -0700 Message-Id: <20220520194320.2356236-4-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The .value is a two-dim array, not a pointer. struct iqk_matrix_regs { bool iqk_done; long value[1][IQK_MATRIX_REG_NUM]; }; Signed-off-by: Jakub Kicinski --- CC: pkshih@realtek.com CC: kvalo@kernel.org CC: keescook@chromium.org CC: colin.king@intel.com CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c index 51fe51bb0504..15e6a6aded31 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c @@ -2386,10 +2386,7 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel) rtl_dbg(rtlpriv, COMP_SCAN, DBG_LOUD, "Just Read IQK Matrix reg for channel:%d....\n", channel); - if ((rtlphy->iqk_matrix[indexforchannel]. - value[0] != NULL) - /*&&(regea4 != 0) */) - _rtl92d_phy_patha_fill_iqk_matrix(hw, true, + _rtl92d_phy_patha_fill_iqk_matrix(hw, true, rtlphy->iqk_matrix[ indexforchannel].value, 0, (rtlphy->iqk_matrix[ From patchwork Fri May 20 19:43:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857399 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8999EC4332F for ; Fri, 20 May 2022 19:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353286AbiETTnb (ORCPT ); Fri, 20 May 2022 15:43:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353281AbiETTn1 (ORCPT ); Fri, 20 May 2022 15:43:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75D73199489; Fri, 20 May 2022 12:43:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0F7C361B9A; Fri, 20 May 2022 19:43:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB9ECC34115; Fri, 20 May 2022 19:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075805; bh=7YbNykz9c0aOCfyDPVpLz+qw4U51npRt4eZFKtm6Hoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qWUE9y/h7QwfETx0oy7xKGmX5Xbb6QWoIx57tCK1rS27ZXCPMC5goUnEKRcnrn8W3 ziF7gZ4qmWgFClZSaFdAAg2ncvljRLlUX8V+cCIpgcpFTEbRlWU26ODdCnzKYLQTjH 6Zz5zvpXFTrGBzlxe1J1RJ4oQjUYh5SvD4cRvyuahuxlHAmOhW1mL4U96vFh6OV90g WnoblE4At5zYaTpaodBxkhl6J7vaewMHV4+Cj3P1YO4aSXdfHqu4Fjyg0tZTapuf1Y tR35OqBy1ydxOyE1P7JbhXzWziWl/c7c9Imu40HyDlW8h96b4ZGiwR5xtlJw6p6L0l H9JiWmbEa/4ng== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH net-next 4/8] wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12 Date: Fri, 20 May 2022 12:43:16 -0700 Message-Id: <20220520194320.2356236-5-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org For some reason GCC 12 decided to complain about the common pattern of queuing an object onto a list on the stack in ath6k: inlined from ‘ath6kl_htc_mbox_tx’ at drivers/net/wireless/ath/ath6kl/htc_mbox.c:1142:3: include/linux/list.h:74:19: warning: storing the address of local variable ‘queue’ in ‘*&packet_15(D)->list.prev’ [-Wdangling-pointer=] 74 | new->prev = prev; | ~~~~~~~~~~^~~~~~ Move the warning to W=1, hopefully it goes away with a compiler update. Signed-off-by: Jakub Kicinski --- CC: kvalo@kernel.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/ath/ath6kl/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/ath6kl/Makefile b/drivers/net/wireless/ath/ath6kl/Makefile index dc2b3b46781e..01cc0d50fee6 100644 --- a/drivers/net/wireless/ath/ath6kl/Makefile +++ b/drivers/net/wireless/ath/ath6kl/Makefile @@ -36,6 +36,11 @@ ath6kl_core-y += wmi.o ath6kl_core-y += core.o ath6kl_core-y += recovery.o +# FIXME: temporarily silence -Wdangling-pointer on non W=1+ builds +ifndef KBUILD_EXTRA_WARN +CFLAGS_htc_mbox.o += -Wno-dangling-pointer +endif + ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o ath6kl_core-$(CONFIG_ATH6KL_TRACING) += trace.o From patchwork Fri May 20 19:43:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857404 X-Patchwork-Delegate: gregory.greenman@intel.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B99A2C433EF for ; Fri, 20 May 2022 19:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350453AbiETTnj (ORCPT ); Fri, 20 May 2022 15:43:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350599AbiETTn3 (ORCPT ); Fri, 20 May 2022 15:43:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE70F19579C; Fri, 20 May 2022 12:43:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8D85B82DC7; Fri, 20 May 2022 19:43:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 087F1C385A9; Fri, 20 May 2022 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075806; bh=kGj4DK2AiH/Fy8GJN92csFdqlx0nkTXqzwCAsyBJgCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ujl4OyJMJhXcqy94icUbv39kImT4xeeZYppNS3omDd7APZFsYsnU6qWEs0/odVo1y tkYZ5xiY7XkxCkbhwnkkzkctDZcIwa0M3XbUb1Ju+W4nB2TS1JgkcHXD3vPWUGAYcp yi4wWQk1iQjhKegscrs6OKQzog7wf6kJtGAvcyhIRJ7btcLoOIhB2DCfENUUIXzjQD 85L1C7q0AJW+U//aORTDKGZ1Z5DybNElM2OIB5mO39yxlHIbba8dwyL2dbNQxZw6Jk zEaKnVwUM0d0wNcrM4tBQKX/CupOACOiJCTjfUXIW8/U8EdVF25EyvfKHKfUT0oq2p qWP7ITzwix7Uw== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , gregory.greenman@intel.com, luciano.coelho@intel.com, johannes.berg@intel.com Subject: [PATCH net-next 5/8] wifi: iwlwifi: use unsigned to silence a GCC 12 warning Date: Fri, 20 May 2022 12:43:17 -0700 Message-Id: <20220520194320.2356236-6-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org GCC 12 says: drivers/net/wireless/intel/iwlwifi/mvm/sta.c:1076:37: warning: array subscript -1 is below array bounds of ‘struct iwl_mvm_tid_data[9]’ [-Warray-bounds] 1076 | if (mvmsta->tid_data[tid].state != IWL_AGG_OFF) | ~~~~~~~~~~~~~~~~^~~~~ Whatever, tid is a bit from for_each_set_bit(), it's clearly unsigned. Signed-off-by: Jakub Kicinski --- CC: gregory.greenman@intel.com CC: kvalo@kernel.org CC: luciano.coelho@intel.com CC: johannes.berg@intel.com CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 406f0a50a5bf..bbb1522e7280 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -1058,7 +1058,7 @@ static bool iwl_mvm_remove_inactive_tids(struct iwl_mvm *mvm, unsigned long *unshare_queues, unsigned long *changetid_queues) { - int tid; + unsigned int tid; lockdep_assert_held(&mvmsta->lock); lockdep_assert_held(&mvm->mutex); From patchwork Fri May 20 19:43:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857402 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE326C433FE for ; Fri, 20 May 2022 19:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350463AbiETTng (ORCPT ); Fri, 20 May 2022 15:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353287AbiETTn2 (ORCPT ); Fri, 20 May 2022 15:43:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9B2F199484; Fri, 20 May 2022 12:43:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 647B761C1A; Fri, 20 May 2022 19:43:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71D2AC3411A; Fri, 20 May 2022 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075806; bh=BsskcfHl/eEdw8cldU32XfsJ2GFxBUuduFu3FrECxWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PNQ9G5LJ/i8yRpHkY51jcEOw3Igs/cRjgDFCNjzzn98rwS1csT+Go5dTYI9gNuEYd me8pCC6wzl02gh1R96sDPLRpktjpH4QXom1kCibdcHHe2r8SeaXQ0U9dFGrihQVPya EOY8b8rvLUVrkgq7y//OMJ55WeRglxkPe4nNDJ2LzAM2JTW64reIK3u5b36/15dtQA U1ZAOZCkk1ZwUbk93DaQ4d7/DITXIEOWcMXRr8LJj2IrtYb5ByIxBAzLDzwPC2Cr6k 1LZSl/GVgznNZoHuKXo8ah+DNuz98HN6TZtoQv8ulYkmj/zU6Qy93fk8fWDu/Ln4eT iJzBqmtdKkLUQ== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , aspriel@gmail.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, ALSI@bang-olufsen.dk, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com Subject: [PATCH net-next 6/8] wifi: brcmfmac: work around a GCC 12 -Warray-bounds warning Date: Fri, 20 May 2022 12:43:18 -0700 Message-Id: <20220520194320.2356236-7-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org GCC 12 really doesn't like partial struct allocations: drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2202:32: warning: array subscript ‘struct brcmf_ext_join_params_le[0]’ is partly outside array bounds of ‘void[70]’ [-Warray-bounds] 2202 | ext_join_params->scan_le.passive_time = | ^~ brcmfmac is trying to save 2 bytes at the end by either allocating or not allocating a channel member. Let's keep @join_params_size the "right" size but kmalloc() the full structure. Signed-off-by: Jakub Kicinski --- CC: aspriel@gmail.com CC: franky.lin@broadcom.com CC: hante.meuleman@broadcom.com CC: kvalo@kernel.org CC: ALSI@bang-olufsen.dk CC: linux-wireless@vger.kernel.org CC: brcm80211-dev-list.pdl@broadcom.com CC: SHA-cyfmac-dev-list@infineon.com --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 360b103fe898..605206abe424 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2167,7 +2167,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, offsetof(struct brcmf_assoc_params_le, chanspec_list); if (cfg->channel) join_params_size += sizeof(u16); - ext_join_params = kzalloc(join_params_size, GFP_KERNEL); + ext_join_params = kzalloc(sizeof(*ext_join_params), GFP_KERNEL); if (ext_join_params == NULL) { err = -ENOMEM; goto done; From patchwork Fri May 20 19:43:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857405 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D067C4332F for ; Fri, 20 May 2022 19:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353310AbiETTnk (ORCPT ); Fri, 20 May 2022 15:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353294AbiETTnb (ORCPT ); Fri, 20 May 2022 15:43:31 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD6C19579C; Fri, 20 May 2022 12:43:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id BA002CE2CE0; Fri, 20 May 2022 19:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F078DC34118; Fri, 20 May 2022 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075807; bh=4oZB8rFjKLED/jr3XhcfTR1suooV0P6bDjygrUvsKhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMV5QsJy+1QT0U+2aMfvDIxlAjp9ezvNgmIslJR4vLTEtTmVhW0ffWxR1p3W2ertC wgVy6cUHE7e5WaY3yigCNU94ZCQLepClZNFoQWkva0T07Xrr471r+URWjOLeFOuy4H FyA1hp44Q1BRJI8luQml2MZVKtTs+jzQ9p2QBE1xrVJTSXodY2/Vgl9BxGkLxNMrym a7VNDMVbffaXYX2SMdPr7sKASO3mZeskRseHaYGrM2eoHpsz1X/39CdBvX9wtEM/LH VbvvovMlipT7X18niNqCC4Kq10e8SW7st5lJZ7w5+p4BJ3ebrK/m628KvplK6MILqz g7Uzr1WispgaQ== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , libertas-dev@lists.infradead.org Subject: [PATCH net-next 7/8] wifi: libertas: silence a GCC 12 -Warray-bounds warning Date: Fri, 20 May 2022 12:43:19 -0700 Message-Id: <20220520194320.2356236-8-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This driver does a lot of casting of smaller buffers to a larger command response struct, GCC 12 does not like that: drivers/net/wireless/marvell/libertas/cfg.c:1198:63: warning: array subscript ‘struct cmd_ds_802_11_associate_response[0]’ is partly outside array bounds of ‘unsigned char[203]’ [-Warray-bounds] 1198 | "aid 0x%04x\n", status, le16_to_cpu(resp->statuscode), | ^~ Annoyingly it's not clever enough to recognize which fields are safe to access, so move this warning to W=1 for now. Signed-off-by: Jakub Kicinski --- CC: kvalo@kernel.org CC: libertas-dev@lists.infradead.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/marvell/libertas/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/marvell/libertas/Makefile b/drivers/net/wireless/marvell/libertas/Makefile index 41b9b440a542..da4ea5a0812c 100644 --- a/drivers/net/wireless/marvell/libertas/Makefile +++ b/drivers/net/wireless/marvell/libertas/Makefile @@ -10,6 +10,11 @@ libertas-y += tx.o libertas-y += firmware.o libertas-$(CONFIG_LIBERTAS_MESH) += mesh.o +# FIXME: temporarily silence -Warray-bounds on non W=1+ builds +ifndef KBUILD_EXTRA_WARN +CFLAGS_cfg.o += -Wno-array-bounds +endif + usb8xxx-objs += if_usb.o libertas_cs-objs += if_cs.o libertas_sdio-objs += if_sdio.o From patchwork Fri May 20 19:43:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12857403 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95022C43219 for ; Fri, 20 May 2022 19:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353305AbiETTnh (ORCPT ); Fri, 20 May 2022 15:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353271AbiETTn2 (ORCPT ); Fri, 20 May 2022 15:43:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22535197F62; Fri, 20 May 2022 12:43:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B235061C1D; Fri, 20 May 2022 19:43:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53017C34119; Fri, 20 May 2022 19:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653075807; bh=1CHHoR/Uc9TOmk7VZ5FDY8+i+nmwtgnWeoA//yxKWSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VqM1rnsQtmb13wh6rKfYCgUzmcvaYU/uYKKtuJFr0yp9u+YuqEkWF5urCMD3Q02pj uBdcLsUFXb7KcY4Di/fnfB+TItyds/+GwXFd/4zujRuaeVc9uBeBXkgXDYpcRLWTbe l1en4UIOgAIZ1TPyxE3Dai4f9SQdGxYKLmNEJTbFK5IRE+tBj7OpmUQ308iAp7HHq+ EuYLoEk6ciIlkkLpm7r4Fk/B4EgV/NgSc8cmFxW+Xq1Y72aUfnvfRuBNaWAD+EzXG3 +BF4gKURMw07rRMy1m9Y8Olv2GLSvzi7winKS2R9pQo9FPWzy3cE2LuBCb20T5/I57 h6xW9YvRMGMEg== From: Jakub Kicinski To: kvalo@kernel.org, johannes@sipsolutions.net Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Jakub Kicinski , chunkeey@googlemail.com Subject: [PATCH net-next 8/8] wifi: carl9170: silence a GCC 12 -Warray-bounds warning Date: Fri, 20 May 2022 12:43:20 -0700 Message-Id: <20220520194320.2356236-9-kuba@kernel.org> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org> References: <20220520194320.2356236-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org carl9170 has a big union (struct carl9170_cmd) with all the command types in it. But it allocates buffers only large enough for a given command. This upsets GCC 12: drivers/net/wireless/ath/carl9170/cmd.c:125:30: warning: array subscript ‘struct carl9170_cmd[0]’ is partly outside array bounds of ‘unsigned char[8]’ [-Warray-bounds] 125 | tmp->hdr.cmd = cmd; | ~~~~~~~~~~~~~^~~~~ Punt the warning to W=1 for now. Hopefully GCC will learn to recognize which fields are in-bounds. Signed-off-by: Jakub Kicinski Acked-by: Christian Lamparter --- CC: chunkeey@googlemail.com CC: kvalo@kernel.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/ath/carl9170/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/carl9170/Makefile b/drivers/net/wireless/ath/carl9170/Makefile index 1a81868ce26d..7463baa62fa8 100644 --- a/drivers/net/wireless/ath/carl9170/Makefile +++ b/drivers/net/wireless/ath/carl9170/Makefile @@ -3,3 +3,8 @@ carl9170-objs := main.o usb.o cmd.o mac.o phy.o led.o fw.o tx.o rx.o carl9170-$(CONFIG_CARL9170_DEBUGFS) += debug.o obj-$(CONFIG_CARL9170) += carl9170.o + +# FIXME: temporarily silence -Warray-bounds on non W=1+ builds +ifndef KBUILD_EXTRA_WARN +CFLAGS_cmd.o += -Wno-array-bounds +endif