Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4702271rdb; Tue, 12 Dec 2023 07:09:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRg0icQwqJsH7c5N3lc4+/2kpeOh59wLLmOL8vdkd9lQxy9rTMmc0CnzDBFyr48emXF+xG X-Received: by 2002:a05:6808:1928:b0:3b8:b063:8247 with SMTP id bf40-20020a056808192800b003b8b0638247mr7360466oib.73.1702393775291; Tue, 12 Dec 2023 07:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702393775; cv=none; d=google.com; s=arc-20160816; b=wa75Vt2lY7Ff27oxs6YEIrkh+tBFc+F328uEfQuDu4S7PZFud32oNPqbOZrE0Owm75 7ZItstNh5/8bY0KioUWxUBc2BTrHdNRzXtqkEOPir3+NQIfnmIQ7KFh/BnFQRHzDwk1f RS9NMA7c29Lbv9AkN5G0/0QXrPOJKwrgaQWAAO+eI9AAwUw+3nQKLl0Gifw3LMDw+lfe 4zg8g0W9NBWgBCTT770IJtCpCtPOOiJoax40tyRpv+4yexov31jUZTkkjCLM8saaMCHw MvnM+7cCgypV5fiBZbW9QmvnVDEyGQCulFJbwFsoTswbo/tvc0PgLC/CrSxl1TX4Xf6d Ch0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=ieUbKIsdytJSC4oF66CRhPSGkioTOAM444BaKAWt2no=; fh=394WqOqPAKB3qDt9YXvq4vxddE86NE0ZN13UHGRh2Z4=; b=cHjhWX251xhdb+DbrWdnVjZwDKmoAx3coYouea2/b+Njx41Kt/co6Q/Dfs0TXBsyN3 PMJfEnv/0Wl5cGZsCZdinfD6StJSzBX7EaOrfwC44cM/Di32kMQY9+OKVVSV4glzN3zN M7cmMSCFTNlLQe3b5Fcl2gXhr71R3mh0Pv1lQ9Oh553d9az6NEE+TYBT8NIa/Y4SwSEL ZLVsknKBZDW8OQaHqfRaZd2HcCgOxXAi59NNO/j4doFG/69V3CsAbpGS7sDaRo+ZuU+G qIz5ZEHAiLS3bYsHsqVys2uDvcJ9QAbUzP2X3Sv4GEBb/ruLCR8NMZYmagDGENgxkKdV oSsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EknqhJ48; spf=pass (google.com: domain of linux-wireless+bounces-699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t3-20020a0561020a0300b004648814f600si1744158vsa.719.2023.12.12.07.09.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 07:09:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EknqhJ48; spf=pass (google.com: domain of linux-wireless+bounces-699-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D65F81C20AC7 for ; Tue, 12 Dec 2023 15:09:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81A50745FB; Tue, 12 Dec 2023 15:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EknqhJ48" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6075B75401; Tue, 12 Dec 2023 15:09:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F0F8C433C7; Tue, 12 Dec 2023 15:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702393770; bh=Dd+Z9g8Wy9pE/XbicCpt6HzoSR2qPgHCFARthzdpVJ0=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=EknqhJ48zdty/TvXxhQhjINVvNz70LWWe1nCJ0hC3o5SwQu1v3g9NkkLvmYnpntZq kuTTu54aL6cCpME7W5w/OZ4ynNorUF6jL6GACwmTP7vGG3lxzUuSODN88EKpcuMyG6 ckCtYRAfESJXYsK/bFIqBYNYxbNTw7jTKFrYNcldjNFSUgvs60t6cvLzWuJpxNKFcF TmOZimDPKkM32RGWMHrGXNg4kxDAIqdrfezpQ+EB3ydFBBOSqKxlnW2C2W+iqWXozO ggAKjG6e/TFBzY/QppVqhjy99DQweo9FJbK8t44OMPq0gdvgBB57AecJ3WyUNR208b OPwuiWsNz1M3w== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH][next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings From: Kalle Valo In-Reply-To: References: To: "Gustavo A. R. Silva" Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170239376588.306086.11901816078975577906.kvalo@kernel.org> Date: Tue, 12 Dec 2023 15:09:27 +0000 (UTC) "Gustavo A. R. Silva" wrote: > Transform zero-length arrays `adm_stat` and `msdu_cnt` into proper > flexible-array members in anonymous union in `struct > mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY() > helper; and fix multiple -Warray-bounds warnings: > > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:483:61: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:490:58: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:492:58: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:469:61: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:477:66: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:479:66: warning: array subscript is outside array bounds of 'struct [0]' [-Warray-bounds=] > > This results in no differences in binary output, helps with the ongoing > efforts to globally enable -Warray-bounds. > > Signed-off-by: Gustavo A. R. Silva > Reviewed-by: Kees Cook Fails to apply, please rebase on top of wireless-next. Recorded preimage for 'drivers/net/wireless/mediatek/mt76/mt7996/mcu.h' error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Applying: wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings Using index info to reconstruct a base tree... M drivers/net/wireless/mediatek/mt76/mt7996/mcu.h Falling back to patching base and 3-way merge... Auto-merging drivers/net/wireless/mediatek/mt76/mt7996/mcu.h CONFLICT (content): Merge conflict in drivers/net/wireless/mediatek/mt76/mt7996/mcu.h Patch failed at 0001 wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings Patch set to Changes Requested. -- https://patchwork.kernel.org/project/linux-wireless/patch/ZVaCNAohuieMmdq9@work/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches