lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aBFKII5I7R2piEcA@pollux>
Date: Tue, 29 Apr 2025 23:52:32 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...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>,
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
	rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
	patches@...ts.linux.dev
Subject: Re: [PATCH v2] rust: device: allow `Device<DeviceContext>::parent()`

On Tue, Apr 29, 2025 at 11:06:29PM +0200, Miguel Ojeda wrote:
> When `CONFIG_AUXILIARY_BUS` is disabled, `parent()` is still dead code:
> 
>     error: method `parent` is never used
>       --> rust/kernel/device.rs:71:19
>        |
>     64 | impl<Ctx: DeviceContext> Device<Ctx> {
>        | ------------------------------------ method in this implementation
>     ...
>     71 |     pub(crate) fn parent(&self) -> Option<&Self> {
>        |                   ^^^^^^
>        |
>        = note: `-D dead-code` implied by `-D warnings`
>        = help: to override `-D warnings` add `#[allow(dead_code)]`
> 
> Thus reintroduce the `expect`, but now as a conditional one. Do so as
> `dead_code` since that is narrower.
> 
> An `allow` would also be possible, but Danilo wants to catch new users
> in the future [1].
> 
> Link: https://lore.kernel.org/rust-for-linux/aBE8qQrpXOfru_K3@pollux/ [1]
> Fixes: ce735e73dd59 ("rust: auxiliary: add auxiliary device / driver abstractions")
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>

Applied to nova-next, thanks!

[ Adjust commit subject to "rust: device: conditionally expect
  `dead_code` for `parent()`". - Danilo ]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ