cloud-hypervisor/devices
Rob Bradford 1dc913427c devices: legacy: Fix beta clippy issues
error: unneeded late initalization
Error:    --> devices/src/legacy/rtc_pl031.rs:294:9
    |
294 |         let v;
    |         ^^^^^^
    |
    = note: `-D clippy::needless-late-init` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `v` here
    |
297 |         let v = if (AMBA_ID_LOW..AMBA_ID_HIGH).contains(&offset) {
    |         +++++++
help: remove the assignments from the branches
    |
299 ~             u32::from(PL031_ID[index])
300 |         } else {
301 ~             match offset {
302 |                 RTCDR => self.get_time(),
303 |                 RTCMR => {
304 |                     // Even though we are not implementing RTC alarm we return the last value
  ...
help: add a semicolon after the `if` expression
    |
317 |         };
    |          +

error: unneeded late initalization
Error:    --> devices/src/legacy/uart_pl011.rs:297:9
    |
297 |         let v;
    |         ^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `v` here
    |
299 |         let v = if (AMBA_ID_LOW..AMBA_ID_HIGH).contains(&(offset >> 2)) {
    |         +++++++
help: remove the assignments from the branches
    |
301 ~             u32::from(PL011_ID[index])
302 |         } else {
303 ~             match offset >> 2 {
304 |                 UARTDR => {
305 |                     let c: u32;
306 |                     let r: u32;
  ...
help: add a semicolon after the `if` expression
    |
340 |         };
    |          +

error: unneeded late initalization
Error:    --> devices/src/legacy/uart_pl011.rs:305:21
    |
305 |                     let c: u32;
    |                     ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `c` here
    |
309 |                     let c: u32 = self.read_fifo.pop_front().unwrap_or_default().into();
    |                     ~~~~~~~~~~

error: unneeded late initalization
Error:    --> devices/src/legacy/uart_pl011.rs:306:21
    |
306 |                     let r: u32;
    |                     ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `r` here
    |
320 |                     let r: u32 = c;
    |                     ~~~~~~~~~~

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-01-14 14:33:18 +00:00
..
src devices: legacy: Fix beta clippy issues 2022-01-14 14:33:18 +00:00
Cargo.toml build: bump anyhow from 1.0.51 to 1.0.52 2021-12-24 00:22:38 +00:00