group reporting: fix bad values of min/max

If you look at the fio output, the group reporting min and max
bandwidth don't match what the actual job reports. This is due
to an error in calculating the min and max values. The aggregate
value is correct, and matches what the job reports.

This did not affect the values that are usually used for reporting,
it's only affecting the group run status output.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/stat.c b/stat.c
index 26f45f4..2ab5f1a 100644
--- a/stat.c
+++ b/stat.c
@@ -1045,10 +1045,11 @@
 
 			bw = 0;
 			if (ts->runtime[j]) {
-				unsigned long runt;
+				unsigned long runt = ts->runtime[j];
+				unsigned long long kb;
 
-				runt = ts->runtime[j];
-				bw = ts->io_bytes[j] / runt;
+				kb = ts->io_bytes[j] / rs->kb_base;
+				bw = kb * 1000 / runt;
 			}
 			if (bw < rs->min_bw[j])
 				rs->min_bw[j] = bw;
@@ -1060,16 +1061,12 @@
 	}
 
 	for (i = 0; i < groupid + 1; i++) {
-		unsigned long max_run[2];
-
 		rs = &runstats[i];
-		max_run[0] = rs->max_run[0];
-		max_run[1] = rs->max_run[1];
 
 		if (rs->max_run[0])
-			rs->agg[0] = (rs->io_kb[0] * 1000) / max_run[0];
+			rs->agg[0] = (rs->io_kb[0] * 1000) / rs->max_run[0];
 		if (rs->max_run[1])
-			rs->agg[1] = (rs->io_kb[1] * 1000) / max_run[1];
+			rs->agg[1] = (rs->io_kb[1] * 1000) / rs->max_run[1];
 	}
 
 	/*