aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2011-06-03 15:13:17 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:57:43 -0500
commitfc251d5c2466413fdd6851e6c3f63e9851bf9d84 (patch)
tree29a4afaf6300ab924e068f01adac8a61f8cd2adf
parent46530e859c730984967b6e9e9cac722470096e18 (diff)
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 <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c
index 6b226cca1e83..7e68d99e9c93 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)
52 if (unlikely(v >= 1000000)) { 52 if (unlikely(v >= 1000000)) {
53 /* cool: > GiByte/s */ 53 /* cool: > GiByte/s */
54 seq_printf(seq, "%ld,", v / 1000000); 54 seq_printf(seq, "%ld,", v / 1000000);
55 v /= 1000000; 55 v %= 1000000;
56 seq_printf(seq, "%03ld,%03ld", v/1000, v % 1000); 56 seq_printf(seq, "%03ld,%03ld", v/1000, v % 1000);
57 } else if (likely(v >= 1000)) 57 } else if (likely(v >= 1000))
58 seq_printf(seq, "%ld,%03ld", v/1000, v % 1000); 58 seq_printf(seq, "%ld,%03ld", v/1000, v % 1000);