Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5562119rdb; Wed, 13 Dec 2023 12:15:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1JmzclPxhRrEhZ1mfPHvuJ1Mfp09PA4zoG1ATwCrNRNt70W7wG8Po+MwyEJAuo/6y4qGh X-Received: by 2002:a05:6a20:ba7:b0:18c:a8ee:b569 with SMTP id i39-20020a056a200ba700b0018ca8eeb569mr4682419pzh.43.1702498502852; Wed, 13 Dec 2023 12:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702498502; cv=none; d=google.com; s=arc-20160816; b=H8+eMGm2PasITZVNE/OurJe2To/RCDoPxBmV5YMmwHfXVq5VESyhTDna3OY0K6FsJj 2sDL8DeoSZhWITq1lmGad5+DyH4+iZYaxmtUcG8lUfA9G5PfWAi1XLRweg1plRwCD4Ip Kd2pSDygruq2D1lyMtMAKzBxqVgXUeMJEgJDMkamoWYy2bI+gWexbYF2qbL4V5eI9UXq xcS3nXBZNYU5scBLPiUkGyJWsmjFsKPGt2ZK1oWEWbHwzMT2epi4IzrOjwDZt078BXdu r/CHzVs2i7NcvkjcCSMzaDLqMGd0CT0k9iFEKyfBSguL7TnsLkEd1LfwwAvMO7s1VOF7 AAsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1HyjzJtPl2sUntsAoFxkWgAbY6M7c0HaPJqZRErlf6Y=; fh=pAhPhhtSMRgmKAj3riWR7GaEuUuCGFhSYkDk6RxvUUo=; b=0g+AfRzIaOwDs8SNpuKJ3fLk3VSeVhgk+fILK/fiZSnS5VH75U/tJs/D/g7gxhilPK UseALX+yOEVyXY+ugnVUFhvIe7GPSQqAkJd3g17MZiQqi9WltYQKGeEPC3fZ2XCP9IQ3 LevFLeaQMypjaJrAv68x1q0NVsMC1WLJ6nnWQq+F7HBvDjGemKbk4iEvSD1GDVpCWNZ+ YQ97By+PpQoNsbMoT69km+ZkWsQ+DEbYVw9IuaoO48za796YX/4/LhPVGj6ZGBZ+ZrSy KyfvBnlHH2Di0agFir9gBqCeAkdpMVvHkK6XAFa87zh/FNxm8A49CUbc9S24AI3XuV74 Jmdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b="F19Xfa/f"; spf=pass (google.com: domain of linux-wireless+bounces-765-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-765-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j3-20020a056a00130300b006ce70be4c40si10028674pfu.349.2023.12.13.12.15.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 12:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-765-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b="F19Xfa/f"; spf=pass (google.com: domain of linux-wireless+bounces-765-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-765-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D547C281C72 for ; Wed, 13 Dec 2023 20:15:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 995717E553; Wed, 13 Dec 2023 20:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b="F19Xfa/f" X-Original-To: linux-wireless@vger.kernel.org Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A717FDB for ; Wed, 13 Dec 2023 12:14:56 -0800 (PST) Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id DUeirKZP58HteDVd9rdlYp; Wed, 13 Dec 2023 20:14:55 +0000 Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with ESMTPS id DVd8rQolqGKIcDVd9rHGVN; Wed, 13 Dec 2023 20:14:55 +0000 X-Authority-Analysis: v=2.4 cv=E+beGIRl c=1 sm=1 tr=0 ts=657a10bf a=1YbLdUo/zbTtOZ3uB5T3HA==:117 a=WzbPXH4gqzPVN0x6HrNMNA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=wYkD_t78qR0A:10 a=VwQbUJbxAAAA:8 a=COk6AnOGAAAA:8 a=uucgfnjzxiVboiWmI4QA:9 a=QEXdDO2ut3YA:10 a=phs4urI-Bf8A:10 a=AjGcO6oz07-iQ99wixmX:22 a=TjNXssC_j7lpFel5tvFf:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1HyjzJtPl2sUntsAoFxkWgAbY6M7c0HaPJqZRErlf6Y=; b=F19Xfa/fVsko11ZYAAp+fLLgQE JKYZf7l5jeio10XKdoJ92Ca6CIbpzzE303mOM8CFzMLyyaaYFNqZorcLQrm3F//jBfGRyM9q+hRw8 85yPu0ZLN1Q0GNj5Wq4d5zJLjkRV/9hcqK5MaeeRLZ1al/HZ7LJ/EKWPIn7LYl+BqV+NUym24eO5o nG1bZsdkm7VNFItpWobUGQCFEJpHzpWyw/14YxHbbaqfGjOfTZoVSKAIdLW2q9Om9sjw86EwnDRoZ XfY6tdpgITObdjqjbmfxrL3jq8ChxnJTW2Y4CE8dLMginTZCjjVGXAe4B8FzflF5iQ6CzIkJnywY1 lugecQPQ==; Received: from 187-162-21-192.static.axtel.net ([187.162.21.192]:60998 helo=[192.168.15.10]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rDVd8-003PFj-0p; Wed, 13 Dec 2023 14:14:54 -0600 Message-ID: Date: Wed, 13 Dec 2023 14:14:53 -0600 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/6] wifi: ath10k: use flexible array in struct wmi_host_mem_chunks Content-Language: en-US To: Jeff Johnson , Kalle Valo Cc: Kees Cook , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231213-wmi_host_mem_chunks_flexarray-v1-0-92922d92fa2c@quicinc.com> <20231213-wmi_host_mem_chunks_flexarray-v1-1-92922d92fa2c@quicinc.com> From: "Gustavo A. R. Silva" In-Reply-To: <20231213-wmi_host_mem_chunks_flexarray-v1-1-92922d92fa2c@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.21.192 X-Source-L: No X-Exim-ID: 1rDVd8-003PFj-0p X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-21-192.static.axtel.net ([192.168.15.10]) [187.162.21.192]:60998 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 2 X-Org: HG=hgshared;ORG=hostgator; X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGo9bQFmk0BbUINlFDdu6Ia+vprTEJjBV0KU4cDd035Rev7hqawnFoaka/EEL4YxdvcgF251F025a3iGbmTvCqfoj3S7r5pT9lgCkRTIGtPN9Cghe5ix TYn2vpgrBkNjs2lKyf38pj9QKOqLFT4d+hd3TDjuVdoad4xUaaoOe70onH26vGN34RAsYaN8kZ3EHpyVaVWvsJcs7RhW2F7SqudlpdZZw6/ZMW2lbNwmimIn On 12/13/23 11:06, Jeff Johnson wrote: > Currently struct wmi_host_mem_chunks defines: > struct host_memory_chunk items[1]; > > Per the guidance in [1] this should be a flexible array. However there > is a documented requirement: > some fw revisions require at least 1 chunk regardless of count > > To satisfy this requirement, follow the guidance from [2] and wrap the > array in a union which contains both the flexible array and a single > instance of the underlying struct. Since the footprint of the struct > is unchanged, no additional driver changes are required. > > No functional changes, compile tested only. > > [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays > [2] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/ > > Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo > --- > drivers/net/wireless/ath/ath10k/wmi.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h > index 9146df98fcee..833ce0251a2c 100644 > --- a/drivers/net/wireless/ath/ath10k/wmi.h > +++ b/drivers/net/wireless/ath/ath10k/wmi.h > @@ -3069,7 +3069,10 @@ struct host_memory_chunk { > struct wmi_host_mem_chunks { > __le32 count; > /* some fw revisions require at least 1 chunk regardless of count */ > - struct host_memory_chunk items[1]; > + union { > + struct host_memory_chunk item; > + DECLARE_FLEX_ARRAY(struct host_memory_chunk, items); > + }; > } __packed; > > struct wmi_init_cmd { >