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@onurozkan.dev>
---
rust/kernel/init.rs | 6 +++---
rust/kernel/kunit.rs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
index 8d228c237954..288b1c2a290d 100644
--- a/rust/kernel/init.rs
+++ b/rust/kernel/init.rs
@@ -30,7 +30,7 @@
//! ## General Examples
//!
//! ```rust,ignore
-//! # #![allow(clippy::disallowed_names)]
+//! # #![expect(clippy::disallowed_names)]
//! use kernel::types::Opaque;
//! use pin_init::pin_init_from_closure;
//!
@@ -67,11 +67,11 @@
//! ```
//!
//! ```rust,ignore
-//! # #![allow(unreachable_pub, clippy::disallowed_names)]
+//! # #![expect(unreachable_pub, clippy::disallowed_names)]
//! use kernel::{prelude::*, types::Opaque};
//! use core::{ptr::addr_of_mut, marker::PhantomPinned, pin::Pin};
//! # mod bindings {
-//! # #![allow(non_camel_case_types)]
+//! # #![expect(non_camel_case_types)]
//! # pub struct foo;
//! # pub unsafe fn init_foo(_ptr: *mut foo) {}
//! # pub unsafe fn destroy_foo(_ptr: *mut foo) {}
diff --git a/rust/kernel/kunit.rs b/rust/kernel/kunit.rs
index 4b8cdcb21e77..91710a1d7b87 100644
--- a/rust/kernel/kunit.rs
+++ b/rust/kernel/kunit.rs
@@ -280,7 +280,7 @@ macro_rules! kunit_unsafe_test_suite {
static mut KUNIT_TEST_SUITE: ::kernel::bindings::kunit_suite =
::kernel::bindings::kunit_suite {
name: KUNIT_TEST_SUITE_NAME,
- #[allow(unused_unsafe)]
+ #[expect(unused_unsafe)]
// SAFETY: `$test_cases` is passed in by the user, and
// (as documented) must be valid for the lifetime of
// the suite (i.e., static).
--
2.50.0
On Tue Jul 1, 2025 at 12:35 AM CDT, Onur Özkan wrote: > 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@onurozkan.dev> > --- > rust/kernel/init.rs | 6 +++--- > rust/kernel/kunit.rs | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs > index 8d228c237954..288b1c2a290d 100644 > --- a/rust/kernel/init.rs > +++ b/rust/kernel/init.rs > @@ -30,7 +30,7 @@ > //! ## General Examples > //! > //! ```rust,ignore > -//! # #![allow(clippy::disallowed_names)] > +//! # #![expect(clippy::disallowed_names)] > //! use kernel::types::Opaque; > //! use pin_init::pin_init_from_closure; > //! > @@ -67,11 +67,11 @@ > //! ``` > //! > //! ```rust,ignore > -//! # #![allow(unreachable_pub, clippy::disallowed_names)] > +//! # #![expect(unreachable_pub, clippy::disallowed_names)] > //! use kernel::{prelude::*, types::Opaque}; > //! use core::{ptr::addr_of_mut, marker::PhantomPinned, pin::Pin}; > //! # mod bindings { > -//! # #![allow(non_camel_case_types)] > +//! # #![expect(non_camel_case_types)] > //! # pub struct foo; > //! # pub unsafe fn init_foo(_ptr: *mut foo) {} > //! # pub unsafe fn destroy_foo(_ptr: *mut foo) {} > diff --git a/rust/kernel/kunit.rs b/rust/kernel/kunit.rs > index 4b8cdcb21e77..91710a1d7b87 100644 > --- a/rust/kernel/kunit.rs > +++ b/rust/kernel/kunit.rs > @@ -280,7 +280,7 @@ macro_rules! kunit_unsafe_test_suite { > static mut KUNIT_TEST_SUITE: ::kernel::bindings::kunit_suite = > ::kernel::bindings::kunit_suite { > name: KUNIT_TEST_SUITE_NAME, > - #[allow(unused_unsafe)] > + #[expect(unused_unsafe)] > // SAFETY: `$test_cases` is passed in by the user, and > // (as documented) must be valid for the lifetime of > // the suite (i.e., static). > -- > 2.50.0 Understood that the files may wind up split here, but the changes look good to me. Reviewed-by: Trevor Gross <tmgross@umich.edu>
On Tue Jul 1, 2025 at 7:35 AM CEST, Onur Özkan wrote: > 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@onurozkan.dev> > --- > rust/kernel/init.rs | 6 +++--- > rust/kernel/kunit.rs | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) @Miguel are you going to pick this eventually, or do you think it should have a new version with the right splitting? --- Cheers, Benno
On Wed, Jul 2, 2025 at 8:47 PM Benno Lossin <lossin@kernel.org> wrote: > > @Miguel are you going to pick this eventually, or do you think it should > have a new version with the right splitting? I guess I could take it since the series can only introduce build failures at worst. However, I thought we were going to do the proper split (as independent patches, too) and then let each maintainer pick each on their own pace. Cheers, Miguel
On Mon Jul 7, 2025 at 3:02 PM CEST, Miguel Ojeda wrote: > On Wed, Jul 2, 2025 at 8:47 PM Benno Lossin <lossin@kernel.org> wrote: >> >> @Miguel are you going to pick this eventually, or do you think it should >> have a new version with the right splitting? > > I guess I could take it since the series can only introduce build > failures at worst. > > However, I thought we were going to do the proper split (as > independent patches, too) and then let each maintainer pick each on > their own pace. I also think it's better to split it correctly. --- Cheers, Benno
© 2016 - 2025 Red Hat, Inc.