diff options
-rw-r--r-- | devices/src/virtio/gpu/backend.rs | 4 | ||||
-rw-r--r-- | src/linux.rs | 7 | ||||
-rw-r--r-- | src/main.rs | 2 | ||||
-rw-r--r-- | sys_util/src/net.rs | 1 |
4 files changed, 7 insertions, 7 deletions
diff --git a/devices/src/virtio/gpu/backend.rs b/devices/src/virtio/gpu/backend.rs index e53adb3..e441541 100644 --- a/devices/src/virtio/gpu/backend.rs +++ b/devices/src/virtio/gpu/backend.rs @@ -725,11 +725,11 @@ impl Backend { } pub fn allocate_using_minigbm(args: ResourceCreateArgs) -> bool { - return args.bind & VIRGL_RES_BIND_SCANOUT != 0 + args.bind & VIRGL_RES_BIND_SCANOUT != 0 && args.depth == 1 && args.array_size == 1 && args.last_level == 0 - && args.nr_samples == 0; + && args.nr_samples == 0 } /// Creates a 3D resource with the given properties and associated it with the given id. diff --git a/src/linux.rs b/src/linux.rs index 84bd699..271cc5b 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -1521,15 +1521,14 @@ fn run_control( warn!("error while reading stdin: {}", e); let _ = poll_ctx.delete(&stdin_handle); } - Ok(count) => match linux.stdio_serial { - Some(ref stdio_serial) => { + Ok(count) => { + if let Some(ref stdio_serial) = linux.stdio_serial { stdio_serial .lock() .queue_input_bytes(&out[..count]) .expect("failed to queue bytes into serial port"); } - None => {} - }, + } } } Token::ChildSignal => { diff --git a/src/main.rs b/src/main.rs index d57174b..9e1bf31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -397,7 +397,7 @@ fn set_argument(cfg: &mut Config, name: &str, value: Option<&str>) -> argument:: } if serial_params.console { - for (_, params) in &cfg.serial_parameters { + for params in cfg.serial_parameters.values() { if params.console { return Err(argument::Error::TooManyArguments(format!( "serial device {} already set as console", diff --git a/sys_util/src/net.rs b/sys_util/src/net.rs index b45e487..70f975b 100644 --- a/sys_util/src/net.rs +++ b/sys_util/src/net.rs @@ -19,6 +19,7 @@ use std::time::Duration; // Offset of sun_path in structure sockaddr_un. fn sun_path_offset() -> usize { // Prefer 0 to null() so that we do not need to subtract from the `sub_path` pointer. + #[allow(clippy::zero_ptr)] let addr = 0 as *const libc::sockaddr_un; // Safe because we only use the dereference to create a pointer to the desired field in // calculating the offset. |