Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3400386rdh; Mon, 27 Nov 2023 13:17:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHi+gdUfCY8stD/C3w6yzDOhzU3tmOegC2W45wVfe/veqQBe9OPa0J2ICHF/ePG/nG4lWbx X-Received: by 2002:a50:9e4e:0:b0:548:b824:1cb8 with SMTP id z72-20020a509e4e000000b00548b8241cb8mr8974129ede.38.1701119822726; Mon, 27 Nov 2023 13:17:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701119822; cv=none; d=google.com; s=arc-20160816; b=ygQdsn1jBCfH8CaJGBtNPBS1N1S2Q64Pi1TmB+ylsfEsCtl1W45vY5LH5C1nEQuEdH 3YbQowEc1DjJLgU2MJ9BQQWEfsIZb5lkbUkcRlABGErNoomjOwRMrNPmG3gP1VnJvbhs evDuEX17k4mhLTyupq3CMFZZpLn87y6jJMJTK66qc0XF0aoMxdez6p1jUhU9dk+XWg3b QWpAQzCuO6dlw85+R2bwEdmI9pedTReg+7m+Ua/wFP4tIjOrSejOoK/0S824EZxv2bhi +S2h7d/hvM79uSzQYO/zdqZ1t6s7wq8ynAaykoRKMtUztJEQbCBSPx5y2IYSRQ5C79OJ FVbQ== 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:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=XKLjnlY9Du+A0CjdLlQjKJ+lZ5W3gM/4bfbQFU2dOrI=; fh=7DacUlkM+NoZ720XZNoUha3ArcUnpp2YSO/D5AvTILQ=; b=ahPtWdz7a9rRMwB2QMzpqWyPHS7EodNJA8GY7nhnKmPF5LPTZZF25vCdcC3UJC3nlC S7ZUbAGniYxwvENIVgFAiEQxwWa2Frv7CEIG/s3KIPjn/dseukQJGKcJHe667zGUeLga habE11vwDCe2boa6vUP0dcGDrY0IUOX0/FjrwdJ/cFtcs8P7a/IvZMltdAJt+JW2N538 OfkvnvUXnZlBk/0tBLg96btNSmA+nEken/FJEG0wb/lYTDXmNVNkTTXzWWdd/qTtM8Ex bSkbpuJf9qm6zbbBVwvL+T0hMDAzfHZuw6Kv09Id8OYvZRJOYAentv0dVlzx0iNG6l6D zYqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=dwduNDRi; spf=pass (google.com: domain of linux-wireless+bounces-130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w7-20020a056402268700b0054b54a18cbfsi2045269edd.597.2023.11.27.13.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 13:17:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-130-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=@sipsolutions.net header.s=mail header.b=dwduNDRi; spf=pass (google.com: domain of linux-wireless+bounces-130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 703221F20F0B for ; Mon, 27 Nov 2023 21:17:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF5284596B; Mon, 27 Nov 2023 21:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="dwduNDRi" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D871A2 for ; Mon, 27 Nov 2023 13:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=XKLjnlY9Du+A0CjdLlQjKJ+lZ5W3gM/4bfbQFU2dOrI=; t=1701119813; x=1702329413; b=dwduNDRicbF9hN0oTtTS7oqyH4jLpSF23yDflVWoJzdtIQ9 se1Qar9xWfKb+neoTySxmFvHspMGaRvfPwDN+xHzhkI9w0A8CkKvI6Ea2C66R+DGs7ca0sn13G2Tr wpPKXsMr05mwlrfwXiAclDHth0D4o+3684R8GKwBp+4EbEWS5CY1cyzf9wfII1DK6o4DdSAOudtfR OjPoKavhOtOKEucLx44Q+STy8bZXQVOtnR44JcMx/aceUZufCZkTu838Rv8y4l0LeLA6OkbuI6+VR jL6e+5JsyzEdzXjXTG52v8acfIv34kEhnggET1z0Smlm6ox6ODESXRUO8TUv0m4g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r7iyJ-00000006Oq2-1z7Y; Mon, 27 Nov 2023 22:16:51 +0100 Message-ID: <0f2e4781cbc994bacae6fe8f56b9aef9fc66bc1a.camel@sipsolutions.net> Subject: Re: [PATCH] wifi: mac80211: use __counted_by for the rest of flexible array members From: Johannes Berg To: Dmitry Antipov Cc: "Gustavo A . R . Silva" , linux-wireless@vger.kernel.org Date: Mon, 27 Nov 2023 22:16:50 +0100 In-Reply-To: <20231127112601.42636-1-dmantipov@yandex.ru> References: <20231127112601.42636-1-dmantipov@yandex.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned On Mon, 2023-11-27 at 14:25 +0300, Dmitry Antipov wrote: > Following commit 9118796dfa67 ("wifi: mac80211: Add __counted_by for stru= ct > ieee802_11_elems and use struct_size()"), use an incoming '__counted_by()= ' > attribute for the flexible array members of 'struct probe_resp', 'struct > fils_discovery_data', 'struct unsol_bcast_probe_resp_data', 'struct > ieee80211_mgd_auth_data' and 'struct ieee80211_mgd_assoc_data', as well a= s > 'struct_size()' helper to allocate an instances of them where appropriate= . > This also introduces reordering of statements in 'ieee80211_mgd_auth()' > and 'ieee80211_mgd_assoc()' because the counter field should (is better > to?) be adjusted before touching the corresponding '__counted_by()' area. For the record, regardless of the commments from Gustavo, I'm going to put this on the back of the list because we have various things in flight now that touch these areas, particularly mgd_auth/mgd_assoc and related code. Not convinced that it's worth making more work on other things for this, when I don't even think (released) compilers have support yet. So just FYI, you might want to come back with this in a month or two when hopefully other things have settled. johannes