From: Lars Ellenberg Date: Fri, 3 Jun 2011 19:13:17 +0000 (+0200) Subject: drbd: cosmetic: fix accidental division instead of modulo when pretty printing X-Git-Tag: v3.12-rc1~1745^2~18^2~193 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc251d5c2466413fdd6851e6c3f63e9851bf9d84;p=kernel%2Fkernel-generic.git drbd: cosmetic: fix accidental division instead of modulo when pretty printing For large resync rates, seq_printf_with_thousands_grouping() accidentally only produced Y,000,00Y, instead of the real numbers. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c index 6b226cc..7e68d99 100644 --- a/drivers/block/drbd/drbd_proc.c +++ b/drivers/block/drbd/drbd_proc.c @@ -52,7 +52,7 @@ void seq_printf_with_thousands_grouping(struct seq_file *seq, long v) if (unlikely(v >= 1000000)) { /* cool: > GiByte/s */ seq_printf(seq, "%ld,", v / 1000000); - v /= 1000000; + v %= 1000000; seq_printf(seq, "%03ld,%03ld", v/1000, v % 1000); } else if (likely(v >= 1000)) seq_printf(seq, "%ld,%03ld", v/1000, v % 1000);