From: Greg KH <gregkh@linuxfoundation.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: Danilo Krummrich <dakr@kernel.org>,
rafael@kernel.org, ojeda@kernel.org, boqun.feng@gmail.com,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, tmgross@umich.edu,
driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] devres: export devres_node_init() and devres_node_add()
Date: Fri, 6 Feb 2026 13:34:03 +0100 [thread overview]
Message-ID: <2026020642-consent-showman-25a8@gregkh> (raw)
In-Reply-To: <CAH5fLgjS+QEGdGnxUBCeMFCapeErRJ6n1rDenbF1ahc5xsJv+Q@mail.gmail.com>
On Fri, Feb 06, 2026 at 12:34:01PM +0100, Alice Ryhl wrote:
> On Fri, Feb 6, 2026 at 12:32 PM Danilo Krummrich <dakr@kernel.org> wrote:
> >
> > On Fri Feb 6, 2026 at 12:04 PM CET, Greg KH wrote:
> > > On Fri, Feb 06, 2026 at 11:43:48AM +0100, Danilo Krummrich wrote:
> > >> On Thu Feb 5, 2026 at 11:31 PM CET, Danilo Krummrich wrote:
> > >> > +EXPORT_SYMBOL_GPL(devres_node_init);
> > >>
> > >> I actually intended to use a Rust helper instead of exporting those symbols
> > >> directly, but forgot to do it eventually.
> > >>
> > >
> > > I don't understand, does that mean we do not need to export these?
> > > Shouldn't the rust bindings just export these symbols are rust exports,
> > > and the C exports are not needed?
> > >
> > > We "only" want these symbols to go to the rust binding, not to any
> > > module at all, which is what this patch series does, and is probably not
> > > a good idea.
> >
> > Correct, I just forgot to replace the exports with a Rust helper.
> >
> > The Rust compiler might inline some of the core code into modules (e.g. due to
> > generics), thus requiring an export.
> >
> > But, instead of adding
> >
> > EXPORT_SYMBOL_GPL(devres_node_init)
> >
> > in drivers/base/devres.c, I actually intended to create a Rust helper in
> > rust/helpers/devres.c:
> >
> > __rust_helper void rust_helper_devres_node_init(struct devres_node *node,
> > dr_node_release_t release,
> > dr_node_free_t free_node)
> > {
> > devres_nod_init(node, release, free_node);
> > }
> >
> > This will automatically create:
> >
> > EXPORT_SYMBOL_RUST_GPL(rust_helper_devres_node_init)
> >
> > behind the scenes.
>
> That doesn't work if this option is enabled:
> https://lore.kernel.org/all/20260203-inline-helpers-v2-0-beb8547a03c9@google.com/
>
> then the helper is linked into the module, so it still has a direct
> call to devres_nod_init.
That's fine, because the rust driver core code should also be built into
the kernel, not as a module, right?
thanks,
greg k-h
next prev parent reply other threads:[~2026-02-06 12:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 22:31 [PATCH 0/5] Use struct devres_node in Devres<T> Danilo Krummrich
2026-02-05 22:31 ` [PATCH 1/5] devres: move struct devres_node into base.h Danilo Krummrich
2026-02-05 22:31 ` [PATCH 2/5] devres: export devres_node_init() and devres_node_add() Danilo Krummrich
2026-02-06 10:43 ` Danilo Krummrich
2026-02-06 11:04 ` Greg KH
2026-02-06 11:32 ` Danilo Krummrich
2026-02-06 11:34 ` Alice Ryhl
2026-02-06 11:46 ` Danilo Krummrich
2026-02-06 12:34 ` Greg KH [this message]
2026-02-06 13:16 ` Danilo Krummrich
2026-02-06 13:20 ` Alice Ryhl
2026-02-06 13:25 ` Greg KH
2026-02-06 13:33 ` Danilo Krummrich
2026-02-06 13:35 ` Alice Ryhl
2026-02-06 13:22 ` Greg KH
2026-02-06 13:33 ` Alice Ryhl
2026-02-06 13:55 ` Greg KH
2026-02-06 14:23 ` Gary Guo
2026-02-06 14:31 ` Greg KH
2026-02-06 15:09 ` Alice Ryhl
2026-02-06 16:31 ` Alice Ryhl
2026-02-06 14:08 ` Danilo Krummrich
2026-02-05 22:31 ` [PATCH 3/5] devres: add devres_node_remove() Danilo Krummrich
2026-02-05 22:31 ` [PATCH 4/5] devres: rename and export set_node_dbginfo() Danilo Krummrich
2026-02-05 22:31 ` [PATCH 5/5] rust: devres: embed struct devres_node directly Danilo Krummrich
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=2026020642-consent-showman-25a8@gregkh \
--to=gregkh@linuxfoundation.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=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox