Skip to content

Commit

Permalink
Update vhost-device-can
Browse files Browse the repository at this point in the history
Fix: No need to check ctrl_rx_queue as used if it's not used.

Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
  • Loading branch information
TimosAmpel committed Mar 26, 2024
1 parent bf6adac commit 01d85cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions staging/vhost-device-console/src/vhu_console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ impl VhostUserConsoleBackend {
vring: &VringRwLock,
) -> Result<bool> {
trace!("process_ctrl_rx_requests");
let mut used_flag = false;

if requests.is_empty() {
trace!("Control rx queue is_empty");
Expand Down Expand Up @@ -320,10 +321,13 @@ impl VhostUserConsoleBackend {
}

let ctrl_msg: VirtioConsoleControl = match self.rx_ctrl_fifo.remove() {
Ok(item) => item,
Ok(item) => {
used_flag = true;
item
}
_ => {
trace!("No rx elements");
return Ok(false);
return Ok(used_flag);
}
};

Expand Down

0 comments on commit 01d85cc

Please sign in to comment.