mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
rust: hpet: decode HPET registers into enums
Generalize timer_and_addr() to decode all registers into a single enum HPETRegister, and use the TryInto derive to separate valid and invalid values. The main advantage lies in checking that all registers are enumerated in the "match" statements. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
aa50bc4fb9
commit
519088b7cf
3 changed files with 119 additions and 107 deletions
|
@ -12,8 +12,6 @@
|
|||
//! See [`PL011State`](crate::device::PL011State) for the device model type and
|
||||
//! the [`registers`] module for register types.
|
||||
|
||||
#![allow(clippy::upper_case_acronyms)]
|
||||
|
||||
use qemu_api::c_str;
|
||||
|
||||
mod device;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue