mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
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:
parent
5778ce9997
commit
094cd35913
4 changed files with 2 additions and 121 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue