stat.c: Superflous n
authorJens Axboe <jens.axboe@oracle.com>
Tue, 6 Mar 2007 14:48:38 +0000 (15:48 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 6 Mar 2007 14:48:38 +0000 (15:48 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
stat.c

diff --git a/stat.c b/stat.c
index 7d93abd..9df6c1c 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -785,7 +785,7 @@ void show_run_stats(void)
 static inline void add_stat_sample(struct io_stat *is, unsigned long data)
 {
        double val = data;
-       double delta, n;
+       double delta;
 
        if (data > is->max_val)
                is->max_val = data;
@@ -793,8 +793,7 @@ static inline void add_stat_sample(struct io_stat *is, unsigned long data)
                is->min_val = data;
 
        delta = val - is->mean;
-       n = is->samples + 1.0;
-       is->mean += delta / n;
+       is->mean += delta / (is->samples + 1.0);
        is->S += delta * (val - is->mean);
 
        is->samples++;