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/devres.rs | 2 +- rust/kernel/driver.rs | 2 +- rust/kernel/drm/ioctl.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rust/kernel/devres.rs b/rust/kernel/devres.rs index 57502534d985..0e9510cf4625 100644 --- a/rust/kernel/devres.rs +++ b/rust/kernel/devres.rs @@ -157,7 +157,7 @@ fn remove_action(this: &Arc<Self>) -> bool { success }
- #[allow(clippy::missing_safety_doc)] + #[expect(clippy::missing_safety_doc)] unsafe extern "C" fn devres_callback(ptr: *mut kernel::ffi::c_void) { let ptr = ptr as *mut DevresInner<T>; // Devres owned this memory; now that we received the callback, drop the `Arc` and hence the diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs index ec9166cedfa7..fc7bd65b01f1 100644 --- a/rust/kernel/driver.rs +++ b/rust/kernel/driver.rs @@ -168,7 +168,7 @@ fn of_id_info(dev: &device::Device) -> Option<&'static Self::IdInfo> { }
#[cfg(not(CONFIG_OF))] - #[allow(missing_docs)] + #[expect(missing_docs)] fn of_id_info(_dev: &device::Device) -> Option<&'static Self::IdInfo> { None } diff --git a/rust/kernel/drm/ioctl.rs b/rust/kernel/drm/ioctl.rs index 445639404fb7..3ae8d2d8263f 100644 --- a/rust/kernel/drm/ioctl.rs +++ b/rust/kernel/drm/ioctl.rs @@ -9,28 +9,28 @@ const BASE: u32 = uapi::DRM_IOCTL_BASE as u32;
/// Construct a DRM ioctl number with no argument. -#[allow(non_snake_case)] +#[expect(non_snake_case)] #[inline(always)] pub const fn IO(nr: u32) -> u32 { ioctl::_IO(BASE, nr) }
/// Construct a DRM ioctl number with a read-only argument. -#[allow(non_snake_case)] +#[expect(non_snake_case)] #[inline(always)] pub const fn IOR<T>(nr: u32) -> u32 { ioctl::_IOR::<T>(BASE, nr) }
/// Construct a DRM ioctl number with a write-only argument. -#[allow(non_snake_case)] +#[expect(non_snake_case)] #[inline(always)] pub const fn IOW<T>(nr: u32) -> u32 { ioctl::_IOW::<T>(BASE, nr) }
/// Construct a DRM ioctl number with a read-write argument. -#[allow(non_snake_case)] +#[expect(non_snake_case)] #[inline(always)] pub const fn IOWR<T>(nr: u32) -> u32 { ioctl::_IOWR::<T>(BASE, nr) -- 2.50.0