From: "Onur Özkan" <work@onurozkan.dev>
To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com
Cc: airlied@gmail.com, simona@ffwll.ch, ojeda@kernel.org,
alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
rafael@kernel.org, viresh.kumar@linaro.org,
gregkh@linuxfoundation.org, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, davidgow@google.com,
nm@ti.com, "Onur Özkan" <work@onurozkan.dev>
Subject: [PATCH v4 4/6] rust: switch to `#[expect(...)]` in devres, driver and ioctl
Date: Tue, 1 Jul 2025 08:35:55 +0300 [thread overview]
Message-ID: <20250701053557.20859-5-work@onurozkan.dev> (raw)
In-Reply-To: <20250701053557.20859-1-work@onurozkan.dev>
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
next prev parent reply other threads:[~2025-07-01 5:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 5:35 [PATCH v4 0/6] replace `allow(...)` lints with `expect(...)` Onur Özkan
2025-07-01 5:35 ` [PATCH v4 1/6] rust: switch to `#[expect(...)]` in core modules Onur Özkan
2025-07-09 2:33 ` Trevor Gross
2025-07-01 5:35 ` [PATCH v4 2/6] rust: switch to `#[expect(...)]` in init and kunit Onur Özkan
2025-07-02 18:47 ` Benno Lossin
2025-07-07 13:02 ` Miguel Ojeda
2025-07-07 15:27 ` Benno Lossin
2025-07-09 2:39 ` Trevor Gross
2025-07-01 5:35 ` [PATCH v4 3/6] drivers: gpu: switch to `#[expect(...)]` in nova-core/regs.rs Onur Özkan
2025-07-09 2:42 ` Trevor Gross
2025-07-01 5:35 ` Onur Özkan [this message]
2025-07-01 5:35 ` [PATCH v4 5/6] rust: remove `#[allow(clippy::unnecessary_cast)]` Onur Özkan
2025-07-09 2:37 ` Trevor Gross
2025-07-01 5:35 ` [PATCH v4 6/6] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]` Onur Özkan
2025-07-01 8:46 ` Miguel Ojeda
2025-07-01 8:43 ` [PATCH v4 0/6] replace `allow(...)` lints with `expect(...)` Miguel Ojeda
2025-07-01 17:27 ` Onur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701053557.20859-5-work@onurozkan.dev \
--to=work@onurozkan.dev \
--cc=a.hindborg@kernel.org \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=davidgow@google.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nm@ti.com \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=tzimmermann@suse.de \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®