Skip to content

Commit

Permalink
Remove invalid loops
Browse files Browse the repository at this point in the history
Fix #104

Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
liuw1 authored and gaojiaqi7 committed Jan 4, 2024
1 parent 4fe0628 commit 3acbf6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/devices/vsock/src/transport/vmcall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl VmcallVsock {
tdx::tdvmcall_service(command, response, VMCALL_VECTOR as u64, timeout)
.map_err(|e| VsockTransportError::Vmcall(e))?;

while !wait_for_event(&VMCALL_FLAG, self.timer.as_ref()) {
if !wait_for_event(&VMCALL_FLAG, self.timer.as_ref()) {
return Err(VsockTransportError::Timeout);
}
self.timer.reset_timeout();
Expand Down Expand Up @@ -176,7 +176,7 @@ impl VmcallVsock {
// TO DO:
// Refactor the waiting logic
loop {
while !wait_for_event(&VMCALL_FLAG, self.timer.as_ref()) {
if !wait_for_event(&VMCALL_FLAG, self.timer.as_ref()) {
return Err(VsockTransportError::Timeout);
}
self.timer.reset_timeout();
Expand Down

0 comments on commit 3acbf6c

Please sign in to comment.