[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2dedlnknikkrwg5f6ocuvjrogdjuqyg4sg6zkkao4w4yyvvsje@dkt7rco3fen3>
Date: Wed, 29 Oct 2025 11:04:12 +0100
From: Uwe Kleine-König <ukleinek@...nel.org>
To: Michal Wilczynski <m.wilczynski@...sung.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 <lossin@...nel.org>, 
	Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, 
	Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, 
	Drew Fustini <fustini@...nel.org>, Guo Ren <guoren@...nel.org>, Fu Wei <wefu@...hat.com>, 
	Stephen Rothwell <sfr@...b.auug.org.au>, rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-pwm@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 0/4] Introduce import_ns support for Rust
Hello,
On Tue, Oct 28, 2025 at 01:22:31PM +0100, Michal Wilczynski wrote:
> This series addresses build warnings reported by `modpost` for the Rust
> PWM driver (`pwm_th1520`) in linux-next:
> 
> WARNING: modpost: module pwm_th1520 uses symbol pwmchip_release from
> namespace PWM, but does not import it.
> 
> These warnings occur because Rust modules, like C modules, need to
> declare their dependencies on C symbols exported to specific namespaces
> (using `EXPORT_SYMBOL_NS` in C). This is done by embedding
> "import_ns=<NAMESPACE>" tags into the module's `.modinfo` section, which
> `modpost` verifies.  The C macro `MODULE_IMPORT_NS()` handles this, but
> the Rust `module!` macro lacked equivalent functionality.
> 
> This series introduces the necessary support:
> 
> Patch 1 extends the core `module!` macro in `rust/macros/module.rs`
> to parse an optional `imports_ns: [...]` field and generate the required
> `import_ns` tags in the `.modinfo` section.
> 
> Patch 2 adds a convenience macro `module_pwm_platform_driver!` to
> `rust/kernel/pwm.rs`. This macro wraps the standard
> `module_platform_driver!` and automatically adds `imports_ns: ["PWM"]`,
> simplifying module declaration for PWM driver authors.
> 
> Patch 3 updates the `pwm_th1520` driver to use the new helper macro,
> fixing the build warnings.
Given that for now the pwm_th1520 driver is the only user, does it make
sense to merge this series via my pwm tree? If it goes via a different
tree, I'd like to have a tag to merge into my tree to hand over code
which is free of warnings to Linus in the next merge window.
> Patch 4 includes a minor clippy style fix for the `pwm_th1520` driver.
If you could mention the command that makes this warning visible, I'd be
glad to add that to my repertoire of build checks.
Thanks for addressing the issue
Uwe
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists
 
