mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborah.brouwer@collabora.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: Daniel Almeida <daniel.almeida@collabora.com>,
	Danilo Krummrich <dakr@kernel.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Benno Lossin <lossin@kernel.org>, Gary Guo <gary@garyguo.net>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	rust-for-linux@vger.kernel.org, karunika.choo@arm.com,
	boris.brezillon@collabora.com, laura.nao@collabora.com,
	steven.price@arm.com, liviu.dudau@arm.com
Subject: Re: [PATCH] drm/tyr: gpu_info: zero out new/unused fields
Date: Wed, 23 Sep 2026 17:27:23 -0700	[thread overview]
Message-ID: <arRua6cN7FXIDOvF@um790> (raw)
In-Reply-To: <CAH5fLghN0w908Z-MYDfmaeC7gvAB78MMT7zg599=1kU0HexkOw@mail.gmail.com>

On Wed, Sep 23, 2026 at 09:42:23AM +0200, Alice Ryhl wrote:
> On Wed, Sep 23, 2026 at 1:16 AM Deborah Brouwer
> <deborah.brouwer@collabora.com> wrote:
> >
> > If a new field is added to the struct drm_panthor_gpu_info in the panthor
> > uapi, Tyr must initialize this field or it will cause a compile error.
> >
> > To pre-emptively avoid compile errors, use ..pin_init::zeroed() to zero
> > out all new fields added to this struct. Tyr can subsequently change the
> > initialization as necessary. Also use it instead of manually zeroing out
> > existing fields at the end of the struct.
> >
> > Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
> 
> Merged into drm-rust-next, thanks!
> 
> With regards to sashiko bot, we should look into whether the
> MaybeZeroable that bindgen adds to structs applies on this struct. If
> so, we can remove our unsafe impl block. But it's not an issue in this
> patch.

I couldn't use MaybeZeroable directly but if I add IntoBytes and
Immutable then we can stop implementing unsafe trait AsBytes. Could you
please review:

https://lore.kernel.org/rust-for-linux/20260923-b4-gpu_info_intobytes-v1-1-bb2173f91e11@collabora.com/


> 
> Alice

  reply	other threads:[~2026-09-24  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 23:16 Deborah Brouwer
2026-09-23  7:42 ` Alice Ryhl
2026-09-24  0:27   ` Deborah Brouwer [this message]
2026-09-24  7:11     ` Alice Ryhl

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=arRua6cN7FXIDOvF@um790 \
    --to=deborah.brouwer@collabora.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=karunika.choo@arm.com \
    --cc=laura.nao@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=lossin@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®