Kaynağa Gözat

IDEChannel: Fix wait_until_not_busy() (#7084)

The time_elapsed variable would count until milliseconds_timeout + 1,
so a != comparision won't work.
Alexander Richards 4 yıl önce
ebeveyn
işleme
28a6a9a08f
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      Kernel/Storage/IDEChannel.cpp

+ 2 - 2
Kernel/Storage/IDEChannel.cpp

@@ -269,7 +269,7 @@ bool IDEChannel::wait_until_not_busy(bool slave, size_t milliseconds_timeout)
         IO::delay(1000);
         IO::delay(1000);
         time_elapsed++;
         time_elapsed++;
     }
     }
-    return time_elapsed != milliseconds_timeout;
+    return time_elapsed <= milliseconds_timeout;
 }
 }
 
 
 bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
 bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
@@ -279,7 +279,7 @@ bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
         IO::delay(1000);
         IO::delay(1000);
         time_elapsed++;
         time_elapsed++;
     }
     }
-    return time_elapsed != milliseconds_timeout;
+    return time_elapsed <= milliseconds_timeout;
 }
 }
 
 
 String IDEChannel::channel_type_string() const
 String IDEChannel::channel_type_string() const