[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFlLjQFZ8gzh5Mz6@cassiopeiae>
Date: Mon, 23 Jun 2025 14:41:49 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, ojeda@...nel.org,
alex.gaynor@...il.com, boqun.feng@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, lossin@...nel.org, a.hindborg@...nel.org,
tmgross@...ch.edu, david.m.ertman@...el.com, ira.weiny@...el.com,
leon@...nel.org, kwilczynski@...nel.org, bhelgaas@...gle.com,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, Dave Airlie <airlied@...hat.com>,
Simona Vetter <simona.vetter@...ll.ch>,
Viresh Kumar <viresh.kumar@...aro.org>
Subject: Re: [PATCH v2 2/4] rust: devres: replace Devres::new_foreign_owned()
On Mon, Jun 23, 2025 at 11:56:39AM +0000, Alice Ryhl wrote:
> On Sun, Jun 22, 2025 at 06:40:39PM +0200, Danilo Krummrich wrote:
> > +pub fn register<T, E>(dev: &Device<Bound>, data: impl PinInit<T, E>, flags: Flags) -> Result
> > +where
> > + T: 'static,
> > + Error: From<E>,
> > +{
> > + let data = KBox::pin_init(data, flags)?;
>
> Wouldn't we also want to expose the ForeignOwnable version? It seems
> likely someone would want to avoid the allocation.
Allowing other things than Box changes the semantics of the API. For instance,
if it'd be a reference counted thing (e.g. Arc), it would basically mean "please
make this object live *at least* as long as the device is bound".
Before considering to allow such things, I really want a potential user to
present a valid use-case for that.
Powered by blists - more mailing lists