Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp362308rdb; Tue, 5 Dec 2023 07:29:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAJha/zTXKy8eI8jabvWmuOvLLGZnj4+0G2T8jFymN231rdq92gS+Oe6JFLpREvtRAbmJZ X-Received: by 2002:a17:907:9058:b0:a19:a1ba:8cf4 with SMTP id az24-20020a170907905800b00a19a1ba8cf4mr3203483ejc.146.1701790156194; Tue, 05 Dec 2023 07:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701790156; cv=none; d=google.com; s=arc-20160816; b=t+tW2vouV4ecMEP4+7kcMYIIimDRWZwDVur3Ag56NRCylDFXh6UYNZkL/PWXvMKBFW bc0RyBKfd/gCCoLWX0rpwi0wGb3KBej46ty3s7uUhgAZQA3B1TL6mN+wSDJI5pJLJRFJ bASqoDEcZoGXW0Q41qk0efFozvKiB2V2wTM6Vldc0Q17Jcm5gmzGUXI+N56y3HmxyqFA TOSfI0OTgoCTtknI4uX0xAA1EE8ELnpuRQadXgVLS4IwF8AtDgdyeO/7KEVGEEPurn5K Tz4Lj7bzg6m6d9JVOlqjCHNMoTGqxLbgLG+F6RFO5WDAsJ7uz8w2/V+K5yQU8weG8CwK FLHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=3fSE5VIhzeCzBFsihDlHNch9Cj0Fh+f/AyIZZwlemTg=; fh=7S2yuY11FUc7nSliM3ry4KOr+DlDMWH9JLeiKVQUX5w=; b=BxawYWGQwisqW1yOD7VLVR9TP7Ne2ipTj74xqDxbsn5EwYZT4E31VMDac9tuVVp2K9 KhwzYEWBnaZotlSv7Io2SJnA++J7r2wyrtzGG9RzELI9/xKDShPJ1evI9TOrXTECwEjA 7SxmeCf52y3cTiJeScKlyQ5x8JkTwBaKXdTx8M7WVhygW/61WB9j1vts/WwAlF9O5RWq eRYDIP7RhytA5T6qbvQupo+YfyAjHGa45ROIJUHQLh+T5/9rWEzu07aeSQYwl4sEnGDo RpjWp8jgs6P2kZV5Ub+ave52ZSGP0V0g1q644U+NUA1dKJ7DPP/Q8YgCgj+ayblcqOPN 6GFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hUkDezEB; spf=pass (google.com: domain of linux-wireless+bounces-429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id rh24-20020a17090720f800b00a1cfc033138si198019ejb.724.2023.12.05.07.29.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:29:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hUkDezEB; spf=pass (google.com: domain of linux-wireless+bounces-429-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-429-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 am.mirrors.kernel.org (Postfix) with ESMTPS id DA9111F21781 for ; Tue, 5 Dec 2023 15:29:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01BE968EA1; Tue, 5 Dec 2023 15:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hUkDezEB" 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 DA5A0AD56 for ; Tue, 5 Dec 2023 15:29:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A90DC433C9; Tue, 5 Dec 2023 15:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701790152; bh=MfLafCfcRaDpmdszQrVQWn7XO/mPGu2x0vw5QhEpwMU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=hUkDezEB4Iwi6LnBU9YZQVH/Z3YCUHfzhbNV5af7LhhqlzL0gSQPDaiLyjeP/KkKr 529hiF43YIwRbaELj0t2q9r2MbylgnOGoPzn2e+cdTIksEkwHCQ9a4GS1q/gpjRPsM msDyp2mexulTyX3XHpruoKphejmCACcFV2QYVQNvM2TiAAT4P3ek9swSkoGYUoJE9X EUxuE55TQuqxMqcUcmHK7jXBkH9JIJCoqUx8tH0KLyCYRUgrTJP2WyP3qj0WPWrp2I Hy1+kqUUG5WtYuzqJWC7PTdDpFiuJaHQH1MyTPRQWGh8pARz2EkIVoxEEpF1L763he g/qK06yXDCOYg== From: Kalle Valo To: Jeff Johnson Cc: "Gustavo A. R. Silva" , "Gustavo A. R. Silva" , Kees Cook , , , , Subject: Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record References: <20231127-flexarray-htc_record-v1-0-6be1f36126fd@quicinc.com> <20231127-flexarray-htc_record-v1-4-6be1f36126fd@quicinc.com> <4f2a486c-c6de-43e4-8bb6-bdd3f819b0a9@embeddedor.com> Date: Tue, 05 Dec 2023 17:29:08 +0200 In-Reply-To: (Jeff Johnson's message of "Mon, 27 Nov 2023 08:32:51 -0800") Message-ID: <87edg0pt17.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jeff Johnson writes: > On 11/27/2023 8:23 AM, Gustavo A. R. Silva wrote: > >> >> >> On 11/27/23 10:14, Jeff Johnson wrote: >>> Transform the zero-length array in ath11k_htc_record into a proper >>> flexible array via the DECLARE_FLEX_ARRAY() macro. This helps with >>> ongoing efforts to globally enable -Warray-bounds. >>> >>> Signed-off-by: Jeff Johnson >>> --- >>> drivers/net/wireless/ath/ath11k/htc.h | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/net/wireless/ath/ath11k/htc.h b/drivers/net/wireless/ath/ath11k/htc.h >>> index 84971cc9251c..e0434b29df70 100644 >>> --- a/drivers/net/wireless/ath/ath11k/htc.h >>> +++ b/drivers/net/wireless/ath/ath11k/htc.h >>> @@ -151,7 +151,7 @@ struct ath11k_htc_credit_report { >>> struct ath11k_htc_record { >>> struct ath11k_htc_record_hdr hdr; >>> union { >>> - struct ath11k_htc_credit_report credit_report[0]; >>> + DECLARE_FLEX_ARRAY(struct ath11k_htc_credit_report, credit_report); >>> }; >> >> Why not removing the `union` and just do a direct transformation [0] -> [ ] ? > > No reason other than staying consistent with ath10k. > Will see if Kalle has an opinion on this. Yeah, I don't see the need for the union and I removed it in the pending branch: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=a2faeea1fe0635563187e7821a6d0baf7b40f2c6 Does it look ok? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches