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>
This commit is contained in:
Paolo Bonzini 2024-12-13 17:54:33 +01:00
parent 5778ce9997
commit 094cd35913
4 changed files with 2 additions and 121 deletions

View file

@ -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,