Skip to content

Commit

Permalink
drbd: cleanup: change "<= 0" to "== 0"
Browse files Browse the repository at this point in the history
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: Dan Carpenter <error27@gmail.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
  • Loading branch information
Dan Carpenter authored and Philipp Reisner committed Oct 14, 2010
1 parent ca0e609 commit 2265769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/drbd/drbd_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void drbd_syncer_progress(struct drbd_conf *mdev, struct seq_file *seq)
/* mean speed since syncer started
* we do account for PausedSync periods */
dt = (jiffies - mdev->rs_start - mdev->rs_paused) / HZ;
if (dt <= 0)
if (dt == 0)
dt = 1;
db = mdev->rs_total - rs_left;
dbdt = Bit2KB(db/dt);
Expand Down

0 comments on commit 2265769

Please sign in to comment.