[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DA1CI71W197Y.1PUFH9H8L05Z8@kernel.org>
Date: Wed, 21 May 2025 00:36:13 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>
Cc: "Miguel Ojeda" <ojeda@...nel.org>, "Alex Gaynor"
<alex.gaynor@...il.com>, "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo"
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <benno.lossin@...ton.me>,
"Andreas Hindborg" <a.hindborg@...nel.org>, "Trevor Gross"
<tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>, "Fiona Behrens"
<me@...enk.dev>, "Lyude Paul" <lyude@...hat.com>,
<rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] rust: derive `Zeroable` for all structs & unions
generated by bindgen where possible
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@...nel.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
Powered by blists - more mailing lists