aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api/src/memory.rs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-12-13 17:54:33 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-03-06 12:44:47 +0100
commit094cd35913bd66228a9a3239e66b1f6f5d667d4b (patch)
tree9ebe0fa26f9f6173b02726237d2194490945e3e0 /rust/qemu-api/src/memory.rs
parent5778ce99971f7e09952a1efbac91d0c97d7a0fee (diff)
downloadqemu-094cd35913bd66228a9a3239e66b1f6f5d667d4b.zip
qemu-094cd35913bd66228a9a3239e66b1f6f5d667d4b.tar.gz
qemu-094cd35913bd66228a9a3239e66b1f6f5d667d4b.tar.bz2
rust: qom: remove operations on &mut
The dubious casts of mutable references to objects are not used anymore: the wrappers for qdev_init_clock_in and for IRQ and MMIO initialization can be called directly on the subclasses, without casts, plus they take a shared reference so they can just use "upcast()" instead of "upcast_mut()". Remove them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/memory.rs')
-rw-r--r--rust/qemu-api/src/memory.rs5
1 files changed, 0 insertions, 5 deletions
diff --git a/rust/qemu-api/src/memory.rs b/rust/qemu-api/src/memory.rs
index eff9f09..fdb1ea1 100644
--- a/rust/qemu-api/src/memory.rs
+++ b/rust/qemu-api/src/memory.rs
@@ -175,11 +175,6 @@ impl MemoryRegion {
) {
unsafe {
Self::do_init_io(
- // self.0.as_mut_ptr() needed because Rust tries to call
- // ObjectDeref::as_mut_ptr() on "&mut Self", instead of coercing
- // to "&Self" and then calling MemoryRegion::as_mut_ptr().
- // Revisit if/when ObjectCastMut is not needed anymore; it is
- // only used in a couple places for initialization.
self.0.as_mut_ptr(),
owner.cast::<Object>(),
&ops.0,