Skip to content

Commit

Permalink
iolog: hist_sum() should return unsigned long
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Aug 8, 2016
1 parent 9316828 commit f2c972c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iolog.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,10 @@ void free_log(struct io_log *log)
sfree(log);
}

static inline int hist_sum(int j, int stride, unsigned int *io_u_plat)
static inline unsigned long hist_sum(int j, int stride, unsigned int *io_u_plat)
{
int k, sum;
unsigned long sum;
int k;

for (k = sum = 0; k < stride; k++)
sum += io_u_plat[j + k];
Expand Down Expand Up @@ -695,7 +696,7 @@ void flush_hist_samples(FILE *f, int hist_coarseness, void *samples,
fprintf(f, "%lu, %u, %u, ", (unsigned long)s->time,
io_sample_ddir(s), s->bs);
for (j = 0; j < FIO_IO_U_PLAT_NR - stride; j += stride) {
fprintf(f, "%lu, ", (unsigned long) hist_sum(j, stride, io_u_plat));
fprintf(f, "%lu, ", hist_sum(j, stride, io_u_plat));
}
fprintf(f, "%lu\n", (unsigned long)
hist_sum(FIO_IO_U_PLAT_NR - stride, stride, io_u_plat));
Expand Down

0 comments on commit f2c972c

Please sign in to comment.