public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Alice Ryhl" <aliceryhl@google.com>, "Gary Guo" <gary@garyguo.net>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Viresh Kumar" <viresh.kumar@linaro.org>,
	"Igor Korotin" <igor.korotin.linux@gmail.com>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Len Brown" <lenb@kernel.org>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH 0/4] Re-export Zeroable and zeroed() from ffi module
Date: Mon, 26 Jan 2026 17:08:08 +0100	[thread overview]
Message-ID: <DFYNFSOP2UVY.27KHATUQMCXHQ@kernel.org> (raw)
In-Reply-To: <aXdrUsrKVmzpBVd8@google.com>

On Mon Jan 26, 2026 at 2:25 PM CET, Alice Ryhl wrote:
> On Mon, Jan 26, 2026 at 01:15:53PM +0000, Gary Guo wrote:
>> On Mon Jan 26, 2026 at 1:05 PM GMT, Alice Ryhl wrote:
>> > Currently, the Zeroable trait is defined by pin-init because pin-init
>> > happens to use the trait. However, zeroed types are useful for many
>> > purposes other than pin-init. Also, we wish to implement Zeroable for
>> > types generated by bindgen. For both of these reasons, re-export
>> > Zeroable from the ffi crate, which is a already dependency of the crates
>> > with bindgen output.
>> 
>> I don't see a benefit of re-exporting these from the `ffi` crate? Especially
>> that we re-export `ffi` crate from kernel crate anyway, and `Zeroable` is
>> already in the kernel prelude.
>> 
>> We already derive `Zeroable` for bindgen via `MaybeZeroable` derive in
>> rust/bindgen_parameters.
>
> I can't find the convo now, but this change is on my list from when we
> discussed also implementing FromBytes / IntoBytes for the bindings
> types. To do that, we need to move our FromBytes / IntoBytes traits
> somewhere that bindings/uapi can access, and we agreed that the ffi
> crate was a good place for it.
>
> And then for consistency, also reexport Zeroable from the same location.

I think you also mentioned at some point that using `pin_init` from
`bindings` seemed strange and also using the `pin_init::zeroed()`
function also doesn't fit, since it doesn't have to do with pinned
initialization.

Cheers,
Benno

  reply	other threads:[~2026-01-26 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 13:05 [PATCH 0/4] Re-export Zeroable and zeroed() from ffi module Alice Ryhl
2026-01-26 13:05 ` [PATCH 1/4] rust: ffi: reexport Zeroable and related items Alice Ryhl
2026-01-26 13:05 ` [PATCH 2/4] rust: cpufreq: import pin_init::zeroed() from ffi Alice Ryhl
2026-01-27  5:20   ` Viresh Kumar
2026-01-26 13:05 ` [PATCH 3/4] rust: i2c: " Alice Ryhl
2026-01-26 13:05 ` [PATCH 4/4] rust: acpi: " Alice Ryhl
2026-01-26 13:15 ` [PATCH 0/4] Re-export Zeroable and zeroed() from ffi module Gary Guo
2026-01-26 13:25   ` Alice Ryhl
2026-01-26 16:08     ` Benno Lossin [this message]
2026-01-26 16:11       ` Gary Guo
2026-01-26 16:14         ` Alice Ryhl
2026-01-27 10:21           ` 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=DFYNFSOP2UVY.27KHATUQMCXHQ@kernel.org \
    --to=lossin@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=igor.korotin.linux@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=viresh.kumar@linaro.org \
    /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