devices: vfio: remove unnecessary MemSlot casts

The values that were cast in these expressions were already MemSlot, so
there is no need to cast back and forth between MemSlot and u32.

BUG=None
TEST=tools/presubmit

Change-Id: I8a215bc50d10a93b21f6d2fe7e4ed7267242a50b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3508320
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2022-03-07 16:19:58 -08:00 committed by Chromeos LUCI
parent 4440db2370
commit 6ba4551b43

View file

@ -918,7 +918,7 @@ impl VfioPciDevice {
};
match response {
VmMemoryResponse::RegisterMemory { pfn: _, slot } => {
mmaps_slots.push(slot as MemSlot);
mmaps_slots.push(slot);
}
_ => break,
}
@ -931,7 +931,7 @@ impl VfioPciDevice {
fn remove_bar_mmap(&self, mmap_slot: &MemSlot) {
if self
.vm_socket_mem
.send(&VmMemoryRequest::UnregisterMemory(*mmap_slot as u32))
.send(&VmMemoryRequest::UnregisterMemory(*mmap_slot))
.is_err()
{
error!("failed to send UnregisterMemory request");