From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C947A606A322 for ; Thu, 3 Dec 2026 20:17:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=eh7KTEYo Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5228C10E3A8; Thu, 3 Dec 2026 20:17:44 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30D6310E3A8 for ; Thu, 3 Dec 2026 20:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796329059; x=1827865059; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=slWsZi6h1lFJWp7Pp2akYiLaSE3aRIMUdofpAwtMpQQ=; b=eh7KTEYoNjFanTVdSoj+R9xNe7wmdpWJg9ivn82GGjjqmPvVd0wbYl4z wgxRERuozwZY8cU9H8VWNy01Kvq9xSzm4D/nKtDxMb24G+dKW+YBonawk YeVvlTajDixCig0dV31BgPXSOFvL2IN96FQd6uExR/mKkcP94QelmwU/n MWnYCul1l5Mcd+dE8jnO1G3OVa7qFqZrTJom4375TBolDdPBSqcFCkreH zCG51IJJv7s6wF/YytQqHkYsKrO0lFzFmDQhI7NI6d2Z5p1PujDw+FSYE EyoTiH2+BDx628i2w7BioyKu1lAHWmH4UboupiO75jxg9PHpM8XlnnH+v w==; X-CSE-ConnectionGUID: IskEmwjyQbGCdr3lLKuQDQ== X-CSE-MsgGUID: 0Ex/l3bpSSaCDOEdQTi95w== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5300192" X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="5300192" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 12:17:38 -0800 X-CSE-ConnectionGUID: GZx4F82mSzGagT9cRpGD8Q== X-CSE-MsgGUID: cPihFdeJSp6GCHUkRjaO0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="14181353" Received: from ncintean-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.190]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 12:17:35 -0800 From: Jani Nikula To: Ville =?utf-8?B?U3lyasOkbMOk?= , Andi Shyti Cc: Krzysztof Karas , intel-gfx@lists.freedesktop.org, Andi Shyti , Janusz Krzysztofik , Sebastian Brzezinka , Krzysztof Niemiec Subject: Re: [PATCH 1/2] drm/i915: Annotate flexible array members that require minimal changes In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland References: <20261119143510.2971237-1-krzysztof.karas@intel.com> <20261119143510.2971237-2-krzysztof.karas@intel.com> Date: Thu, 03 Dec 2026 22:17:32 +0200 Message-ID: <79087f83a6f20acb55ed37cbee3bc11876e63a82@intel.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-gfx" X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, 03 Dec 2026, Ville Syrj=C3=A4l=C3=A4 wrote: > On Thu, Dec 03, 2026 at 03:33:52PM +0100, Andi Shyti wrote: >> Hi Ville, >>=20 >> > > @@ -492,12 +494,14 @@ init_bdb_block(struct intel_display *display, >> > > if (section_id =3D=3D BDB_MIPI_SEQUENCE && *(const u8 *)block >=3D= 3) >> > > block_size +=3D 5; >> > >=20=20 >> > > - entry =3D kzalloc_flex(*entry, data, max(min_size, block_size) + 3= ); >> > > + data_size =3D max(min_size, block_size) + 3; >> > > + entry =3D kzalloc_flex(*entry, data, data_size); >> > > if (!entry) { >> > > kfree(temp_block); >> > > return; >> > > } >> > >=20=20 >> > > + entry->data_size =3D data_size; >> >=20 >> > Are we actually going to do something with this, or what's point? >>=20 >> if you are referring to the use of the __counted_by() annotation, >> the point is that it adds some direction to the compiler for >> better and safer bounds checking and that's a more modern way for >> handling flexible arrays. >>=20 >> Krzysztof's series is just a clean up, there is no functional >> change. > > The commit message explains none of it. And if the compiler does > something magical with it then I'd expect to see an asm snippet > or something to show it. And, looping back to the original comment, there's no point in adding a new __counted_by() member to a struct if it's not used for *anything*. BR, Jani. --=20 Jani Nikula, Intel