All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: Krzysztof Karas <krzysztof.karas@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Andi Shyti <andi.shyti@linux.intel.com>,
	Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	Krzysztof Niemiec <krzysztof.niemiec@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Annotate flexible array members that require minimal changes
Date: Thu, 3 Dec 2026 16:59:32 +0200	[thread overview]
Message-ID: <axGD1LfzHXu2AjEu@intel.com> (raw)
In-Reply-To: <axF8wAS78LjjX44o@zenone.zhora.eu>

On Thu, Dec 03, 2026 at 03:33:52PM +0100, Andi Shyti wrote:
> Hi Ville,
> 
> > > @@ -492,12 +494,14 @@ init_bdb_block(struct intel_display *display,
> > >  	if (section_id == BDB_MIPI_SEQUENCE && *(const u8 *)block >= 3)
> > >  		block_size += 5;
> > >  
> > > -	entry = kzalloc_flex(*entry, data, max(min_size, block_size) + 3);
> > > +	data_size = max(min_size, block_size) + 3;
> > > +	entry = kzalloc_flex(*entry, data, data_size);
> > >  	if (!entry) {
> > >  		kfree(temp_block);
> > >  		return;
> > >  	}
> > >  
> > > +	entry->data_size = data_size;
> > 
> > Are we actually going to do something with this, or what's point?
> 
> 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.
> 
> 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.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-12-03 14:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 14:35 [PATCH 0/2] drm/i915: Annotate flexible array members with __counted_by() attribute Krzysztof Karas
2026-11-19 14:35 ` [PATCH 1/2] drm/i915: Annotate flexible array members that require minimal changes Krzysztof Karas
2026-11-19 14:44   ` Ville Syrjälä
2026-11-23 11:42     ` Krzysztof Karas
2026-12-03 14:33     ` Andi Shyti
2026-12-03 14:59       ` Ville Syrjälä [this message]
2026-12-03 20:17         ` Jani Nikula
2026-11-19 14:35 ` [PATCH 2/2] drm/i915/query: Use __counted_by() to annotate flexible arrays Krzysztof Karas
2026-11-19 14:42   ` sashiko-bot
2026-11-19 16:50 ` ✓ i915.CI.BAT: success for drm/i915: Annotate flexible array members with __counted_by() attribute Patchwork
2026-11-20 17:23 ` ✗ i915.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axGD1LfzHXu2AjEu@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=andi.shyti@kernel.org \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.