File tree 3 files changed +14
-16
lines changed
3 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,15 @@ impl SysTmr {
69
69
pub fn get_system_timer ( & self ) -> u64 {
70
70
// Since it is MMIO, we must emit two separate 32 bit reads
71
71
let mut hi = self . SYSTMR_HI . get ( ) ;
72
+ let mut lo = self . SYSTMR_LO . get ( ) ;
72
73
73
- // We have to repeat if high word changed during read. It
74
- // looks a bit odd, but clippy insists that this is idiomatic
75
- // Rust!
76
- let lo = if hi != self . SYSTMR_HI . get ( ) {
74
+ // We have to repeat if high word changed during read. This
75
+ // will emit a clippy warning that needs be ignored, or you
76
+ // lose an MMIO read.
77
+ if hi != self . SYSTMR_HI . get ( ) {
77
78
hi = self . SYSTMR_HI . get ( ) ;
78
- self . SYSTMR_LO . get ( )
79
- } else {
80
- self . SYSTMR_LO . get ( )
81
- } ;
79
+ lo = self . SYSTMR_LO . get ( ) ;
80
+ }
82
81
83
82
// Compose long int value
84
83
( u64:: from ( hi) << 32 ) | u64:: from ( lo)
Original file line number Diff line number Diff line change @@ -69,16 +69,15 @@ impl SysTmr {
69
69
pub fn get_system_timer ( & self ) -> u64 {
70
70
// Since it is MMIO, we must emit two separate 32 bit reads
71
71
let mut hi = self . SYSTMR_HI . get ( ) ;
72
+ let mut lo = self . SYSTMR_LO . get ( ) ;
72
73
73
- // We have to repeat if high word changed during read. It
74
- // looks a bit odd, but clippy insists that this is idiomatic
75
- // Rust!
76
- let lo = if hi != self . SYSTMR_HI . get ( ) {
74
+ // We have to repeat if high word changed during read. This
75
+ // will emit a clippy warning that needs be ignored, or you
76
+ // lose an MMIO read.
77
+ if hi != self . SYSTMR_HI . get ( ) {
77
78
hi = self . SYSTMR_HI . get ( ) ;
78
- self . SYSTMR_LO . get ( )
79
- } else {
80
- self . SYSTMR_LO . get ( )
81
- } ;
79
+ lo = self . SYSTMR_LO . get ( ) ;
80
+ }
82
81
83
82
// Compose long int value
84
83
( u64:: from ( hi) << 32 ) | u64:: from ( lo)
You can’t perform that action at this time.
0 commit comments