[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQm8sNvcunHF9mPr@google.com>
Date: Tue, 4 Nov 2025 08:43:28 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, david.m.ertman@...el.com,
ira.weiny@...el.com, leon@...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,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: auxiliary: fix false positive warning for missing a
safety comment
On Mon, Nov 03, 2025 at 09:39:18PM +0100, Danilo Krummrich wrote:
> Some older (yet supported) versions of clippy throw a false positive
> warning for missing a safety comment when the safety comment is on a
> multiline statement.
>
> warning: unsafe block missing a safety comment
> --> rust/kernel/auxiliary.rs:351:22
> |
> 351 | Self(unsafe { NonNull::new_unchecked(adev) }),
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |
> = help: consider adding a safety comment on the preceding line
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
> = note: requested on the command line with `-W clippy::undocumented-unsafe-blocks`
>
> warning: 1 warning emitted
>
> Fix this by placing the safety comment right on top of the same line
> introducing the unsafe block.
>
> Fixes: e4e679c8608e ("rust: auxiliary: unregister on parent device unbind")
> Signed-off-by: Danilo Krummrich <dakr@...nel.org>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Powered by blists - more mailing lists