diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-22 08:43:31 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-22 08:43:31 -0800 |
| commit | 1dd419145d090f8fdf149cbb39dea6d968659dd2 (patch) | |
| tree | c5390477ec8356046ba72bb88bf053148a0b9a6d /rust/kernel/irq | |
| parent | d2ba6e9c0ae54b3d0973e23d8806cd9a16b9faef (diff) | |
| parent | 97b281d7edb2ae662365be2809cd728470119720 (diff) | |
Merge tag 'rust-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux
Pull rust fixes from Miguel Ojeda:
"Toolchain and infrastructure:
- Pass '-Zunstable-options' flag required by the future Rust 1.95.0
- Fix 'objtool' warning for Rust 1.84.0
'kernel' crate:
- 'irq' module: add missing bound detected by the future Rust 1.95.0
- 'list' module: add missing 'unsafe' blocks and placeholder safety
comments to macros (an issue for future callers within the crate)
'pin-init' crate:
- Clean Clippy warning that changed behavior in the future Rust
1.95.0"
* tag 'rust-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux:
rust: list: Add unsafe blocks for container_of and safety comments
rust: pin-init: replace clippy `expect` with `allow`
rust: irq: add `'static` bounds to irq callbacks
objtool/rust: add one more `noreturn` Rust function
rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0
Diffstat (limited to 'rust/kernel/irq')
| -rw-r--r-- | rust/kernel/irq/request.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rust/kernel/irq/request.rs b/rust/kernel/irq/request.rs index 67769800117c..7a36f790593e 100644 --- a/rust/kernel/irq/request.rs +++ b/rust/kernel/irq/request.rs @@ -260,7 +260,10 @@ impl<T: Handler + 'static> Registration<T> { /// # Safety /// /// This function should be only used as the callback in `request_irq`. -unsafe extern "C" fn handle_irq_callback<T: Handler>(_irq: i32, ptr: *mut c_void) -> c_uint { +unsafe extern "C" fn handle_irq_callback<T: Handler + 'static>( + _irq: i32, + ptr: *mut c_void, +) -> c_uint { // SAFETY: `ptr` is a pointer to `Registration<T>` set in `Registration::new` let registration = unsafe { &*(ptr as *const Registration<T>) }; // SAFETY: The irq callback is removed before the device is unbound, so the fact that the irq @@ -478,7 +481,7 @@ impl<T: ThreadedHandler + 'static> ThreadedRegistration<T> { /// # Safety /// /// This function should be only used as the callback in `request_threaded_irq`. -unsafe extern "C" fn handle_threaded_irq_callback<T: ThreadedHandler>( +unsafe extern "C" fn handle_threaded_irq_callback<T: ThreadedHandler + 'static>( _irq: i32, ptr: *mut c_void, ) -> c_uint { @@ -494,7 +497,10 @@ unsafe extern "C" fn handle_threaded_irq_callback<T: ThreadedHandler>( /// # Safety /// /// This function should be only used as the callback in `request_threaded_irq`. -unsafe extern "C" fn thread_fn_callback<T: ThreadedHandler>(_irq: i32, ptr: *mut c_void) -> c_uint { +unsafe extern "C" fn thread_fn_callback<T: ThreadedHandler + 'static>( + _irq: i32, + ptr: *mut c_void, +) -> c_uint { // SAFETY: `ptr` is a pointer to `ThreadedRegistration<T>` set in `ThreadedRegistration::new` let registration = unsafe { &*(ptr as *const ThreadedRegistration<T>) }; // SAFETY: The irq callback is removed before the device is unbound, so the fact that the irq |
