[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250701053557.20859-2-work@onurozkan.dev>
Date: Tue, 1 Jul 2025 08:35:52 +0300
From: Onur Özkan <work@...rozkan.dev>
To: rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org,
linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com
Cc: airlied@...il.com,
simona@...ll.ch,
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,
aliceryhl@...gle.com,
tmgross@...ch.edu,
rafael@...nel.org,
viresh.kumar@...aro.org,
gregkh@...uxfoundation.org,
maarten.lankhorst@...ux.intel.com,
mripard@...nel.org,
tzimmermann@...e.de,
davidgow@...gle.com,
nm@...com,
Onur Özkan <work@...rozkan.dev>
Subject: [PATCH v4 1/6] rust: switch to `#[expect(...)]` in core modules
This makes it clear that the warning is expected not just
ignored, so we don't end up having various unnecessary
linting rules in the codebase.
Some parts of the codebase already use this approach, this
patch just applies it more broadly.
No functional changes.
Signed-off-by: Onur Özkan <work@...rozkan.dev>
---
rust/kernel/alloc/allocator_test.rs | 2 +-
rust/kernel/error.rs | 2 +-
rust/kernel/types.rs | 2 +-
rust/macros/helpers.rs | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/alloc/allocator_test.rs b/rust/kernel/alloc/allocator_test.rs
index d19c06ef0498..844197d7194e 100644
--- a/rust/kernel/alloc/allocator_test.rs
+++ b/rust/kernel/alloc/allocator_test.rs
@@ -7,7 +7,7 @@
//! `Cmalloc` allocator within the `allocator_test` module and type alias all kernel allocators to
//! `Cmalloc`. The `Cmalloc` allocator uses libc's `realloc()` function as allocator backend.
-#![allow(missing_docs)]
+#![expect(missing_docs)]
use super::{flags::*, AllocError, Allocator, Flags};
use core::alloc::Layout;
diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 3dee3139fcd4..a59613918d4c 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -263,7 +263,7 @@ fn from(e: core::convert::Infallible) -> Error {
/// [`samples/rust/rust_minimal.rs`]):
///
/// ```
-/// # #[allow(clippy::single_match)]
+/// # #[expect(clippy::single_match)]
/// fn example() -> Result {
/// let mut numbers = KVec::new();
///
diff --git a/rust/kernel/types.rs b/rust/kernel/types.rs
index 22985b6f6982..a5d5a4737a41 100644
--- a/rust/kernel/types.rs
+++ b/rust/kernel/types.rs
@@ -600,5 +600,5 @@ pub enum Either<L, R> {
/// constructed.
///
/// [`NotThreadSafe`]: type@...ThreadSafe
-#[allow(non_upper_case_globals)]
+#[expect(non_upper_case_globals)]
pub const NotThreadSafe: NotThreadSafe = PhantomData;
diff --git a/rust/macros/helpers.rs b/rust/macros/helpers.rs
index e2602be402c1..6fd1462ff01a 100644
--- a/rust/macros/helpers.rs
+++ b/rust/macros/helpers.rs
@@ -98,7 +98,7 @@ pub(crate) fn file() -> String {
}
#[cfg(CONFIG_RUSTC_HAS_SPAN_FILE)]
- #[allow(clippy::incompatible_msrv)]
+ #[expect(clippy::incompatible_msrv)]
{
proc_macro::Span::call_site().file()
}
--
2.50.0
Powered by blists - more mailing lists