diff options
Diffstat (limited to 'rust/kernel/block/mq/request.rs')
| -rw-r--r-- | rust/kernel/block/mq/request.rs | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs index 4a5b7ec914ef..fefd394f064a 100644 --- a/rust/kernel/block/mq/request.rs +++ b/rust/kernel/block/mq/request.rs @@ -69,7 +69,7 @@ impl<T: Operations> Request<T> {          // INVARIANT: By the safety requirements of this function, invariants are upheld.          // SAFETY: By the safety requirement of this function, we own a          // reference count that we can pass to `ARef`. -        unsafe { ARef::from_raw(NonNull::new_unchecked(ptr as *const Self as *mut Self)) } +        unsafe { ARef::from_raw(NonNull::new_unchecked(ptr.cast())) }      }      /// Notify the block layer that a request is going to be processed now. @@ -125,7 +125,12 @@ impl<T: Operations> Request<T> {          // success of the call to `try_set_end` guarantees that there are no          // `ARef`s pointing to this request. Therefore it is safe to hand it          // back to the block layer. -        unsafe { bindings::blk_mq_end_request(request_ptr, bindings::BLK_STS_OK as _) }; +        unsafe { +            bindings::blk_mq_end_request( +                request_ptr, +                bindings::BLK_STS_OK as bindings::blk_status_t, +            ) +        };          Ok(())      } @@ -155,7 +160,7 @@ impl<T: Operations> Request<T> {          // the private data associated with this request is initialized and          // valid. The existence of `&self` guarantees that the private data is          // valid as a shared reference. -        unsafe { Self::wrapper_ptr(self as *const Self as *mut Self).as_ref() } +        unsafe { Self::wrapper_ptr(core::ptr::from_ref(self).cast_mut()).as_ref() }      }  } | 
