Skip to content

Commit

Permalink
IDEChannel: Fix wait_until_not_busy() (SerenityOS#7084)
Browse files Browse the repository at this point in the history
The time_elapsed variable would count until milliseconds_timeout + 1,
so a != comparision won't work.
  • Loading branch information
ElectrodeYT authored May 13, 2021
1 parent 8693c92 commit 28a6a9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kernel/Storage/IDEChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ bool IDEChannel::wait_until_not_busy(bool slave, size_t milliseconds_timeout)
IO::delay(1000);
time_elapsed++;
}
return time_elapsed != milliseconds_timeout;
return time_elapsed <= milliseconds_timeout;
}

bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
Expand All @@ -279,7 +279,7 @@ bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
IO::delay(1000);
time_elapsed++;
}
return time_elapsed != milliseconds_timeout;
return time_elapsed <= milliseconds_timeout;
}

String IDEChannel::channel_type_string() const
Expand Down

0 comments on commit 28a6a9a

Please sign in to comment.