summaryrefslogtreecommitdiff
path: root/stats.h
diff options
context:
space:
mode:
authorMartin Peschke <mpeschke@linux.vnet.ibm.com>2009-04-20 16:07:11 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-04-21 09:21:55 +0200
commitb5f8804a588fffdea10a0cd46a36fc196acea9f2 (patch)
tree83415101c606bf5eebd1bb22ab6e60609c7b9128 /stats.h
parent8d388c8ea6a58186bfdf7ca7fc4e1268eced8b14 (diff)
downloadblktrace-b5f8804a588fffdea10a0cd46a36fc196acea9f2.tar.gz
blktrace-b5f8804a588fffdea10a0cd46a36fc196acea9f2.tar.bz2
fix off-by-one issues in blkiomon.h
Fix two off-by-one issues. Last bucket of histogram was ommitted by mistake when being converted to big-endian or when being merged with another bucket. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'stats.h')
-rw-r--r--stats.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/stats.h b/stats.h
index e519af4..fdedf27 100644
--- a/stats.h
+++ b/stats.h
@@ -124,7 +124,7 @@ static inline void histlog2_merge(struct histlog2 *h, __u32 *dst, __u32 *src)
{
int i;
- for (i = 0; i < h->num - 1; i++)
+ for (i = 0; i < h->num; i++)
dst[i] += src[i];
}
@@ -132,7 +132,7 @@ static inline void histlog2_to_be(__u32 a[], struct histlog2 *h)
{
int i;
- for (i = 0; i < h->num - 1; i++)
+ for (i = 0; i < h->num; i++)
a[i] = cpu_to_be32(a[i]);
}