diff options
author | David Tolnay <dtolnay@chromium.org> | 2019-04-15 15:30:21 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-17 17:22:57 -0700 |
commit | 1c5e2557e2eb3992c320b658ef117cb578bc6fe1 (patch) | |
tree | 03c48568332467b36db736f8d173ead442c7963e /devices/src/ioapic.rs | |
parent | 35ee9d918404ee87abdd23a450fdb483388e1932 (diff) | |
download | crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.gz crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.bz2 crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.lz crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.xz crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.zst crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.zip |
edition: Eliminate blocks superseded by NLL
Before the new borrow checker in the 2018 edition, we sometimes used to have to manually insert curly braced blocks to limit the scope of borrows. These are no longer needed. Details in: https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/non-lexical-lifetimes.html TEST=cargo check --all-features TEST=local kokoro Change-Id: I59f9f98dcc03c8790c53e080a527ad9b68c8d6f3 Reviewed-on: https://chromium-review.googlesource.com/1568075 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'devices/src/ioapic.rs')
-rw-r--r-- | devices/src/ioapic.rs | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/devices/src/ioapic.rs b/devices/src/ioapic.rs index d8b3808..0e9c89b 100644 --- a/devices/src/ioapic.rs +++ b/devices/src/ioapic.rs @@ -261,27 +261,25 @@ impl Ioapic { return; } - { - let entry = &mut self.redirect_table[index]; - if is_high_bits { - entry.set(32, 32, val.into()); - } else { - let before = *entry; - entry.set(0, 32, val.into()); - - // respect R/O bits. - entry.set_delivery_status(before.get_delivery_status()); - entry.set_remote_irr(before.get_remote_irr()); - - // Clear remote_irr when switching to edge_triggered. - if entry.get_trigger_mode() == TriggerMode::Edge { - entry.set_remote_irr(false); - } - - // NOTE: on pre-4.0 kernels, there's a race we would need to work around. - // "KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race" - // is the fix for this. + let entry = &mut self.redirect_table[index]; + if is_high_bits { + entry.set(32, 32, val.into()); + } else { + let before = *entry; + entry.set(0, 32, val.into()); + + // respect R/O bits. + entry.set_delivery_status(before.get_delivery_status()); + entry.set_remote_irr(before.get_remote_irr()); + + // Clear remote_irr when switching to edge_triggered. + if entry.get_trigger_mode() == TriggerMode::Edge { + entry.set_remote_irr(false); } + + // NOTE: on pre-4.0 kernels, there's a race we would need to work around. + // "KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race" + // is the fix for this. } // TODO(mutexlox): route MSI. |