Commit 22657695 authored by Dan Carpenter's avatar Dan Carpenter Committed by Philipp Reisner

drbd: cleanup: change "<= 0" to "== 0"

dt is unsigned so it's never less than zero.  We are calculating the
elapsed time, and that's never less than zero (unless there is a bug or
we invent time travel).  The comparison here is just to guard against
divide by zero bugs.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
parent ca0e6098
...@@ -118,7 +118,7 @@ static void drbd_syncer_progress(struct drbd_conf *mdev, struct seq_file *seq) ...@@ -118,7 +118,7 @@ static void drbd_syncer_progress(struct drbd_conf *mdev, struct seq_file *seq)
/* mean speed since syncer started /* mean speed since syncer started
* we do account for PausedSync periods */ * we do account for PausedSync periods */
dt = (jiffies - mdev->rs_start - mdev->rs_paused) / HZ; dt = (jiffies - mdev->rs_start - mdev->rs_paused) / HZ;
if (dt <= 0) if (dt == 0)
dt = 1; dt = 1;
db = mdev->rs_total - rs_left; db = mdev->rs_total - rs_left;
dbdt = Bit2KB(db/dt); dbdt = Bit2KB(db/dt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment