All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Alice Ryhl" <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Fiona Behrens" <me@kloenk.dev>, "Lyude Paul" <lyude@redhat.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] rust: derive `Zeroable` for all structs & unions generated by bindgen where possible
Date: Wed, 21 May 2025 00:36:13 +0200	[thread overview]
Message-ID: <DA1CI71W197Y.1PUFH9H8L05Z8@kernel.org> (raw)
In-Reply-To: <CAH5fLghdQEsBCfLVy2nUBvY6=5QTeaFyqtHHSjPDaX-1BKP=6g@mail.gmail.com>

On Tue May 20, 2025 at 11:38 PM CEST, Alice Ryhl wrote:
> On Tue, May 20, 2025 at 12:23 PM Benno Lossin <lossin@kernel.org> wrote:
>> diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters
>> index 0f96af8b9a7f..fa4c61ba028f 100644
>> --- a/rust/bindgen_parameters
>> +++ b/rust/bindgen_parameters
>> @@ -34,3 +34,7 @@
>>  # We use const helpers to aid bindgen, to avoid conflicts when constants are
>>  # recognized, block generation of the non-helper constants.
>>  --blocklist-item ARCH_SLAB_MINALIGN
>> +
>> +# Structs should implement Zeroable when all of their fields do.
>> +--with-derive-custom-struct .*=pin_init::MaybeZeroable
>> +--with-derive-custom-union .*=pin_init::MaybeZeroable
>
> Maybe add an import in bindings/lib.rs and use it directly? Seems a
> bit nicer to read without the prefix.

I don't mind doing this, but I don't really see the value in it. I view
the generated bindings from time to time, but having the extra path
wouldn't bother me.

I'll add it to the changes on the next version, but if you have some
better justification, I'd love to hear it.

---
Cheers,
Benno

  reply	other threads:[~2025-05-20 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20 19:23 [PATCH 1/2] rust: add `pin-init` as a dependency to `bindings` and `uapi` Benno Lossin
2025-05-20 19:23 ` [PATCH 2/2] rust: derive `Zeroable` for all structs & unions generated by bindgen where possible Benno Lossin
2025-05-20 21:38   ` Alice Ryhl
2025-05-20 22:36     ` Benno Lossin [this message]
2025-05-20 19:24 ` [PATCH 1/2] rust: add `pin-init` as a dependency to `bindings` and `uapi` Tamir Duberstein
2025-05-20 19:47 ` Benno Lossin

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=DA1CI71W197Y.1PUFH9H8L05Z8@kernel.org \
    --to=lossin@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=me@kloenk.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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.